Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 11th, 2003, 04:33 PM
sandipt sandipt is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 14 sandipt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Add Previous record in Next Record

Hi
I am new to this forum and have one problem. I want to extract data from previous record to next new record. How can i do this?
eg. I have field A,B,C,D after entering 1st record when I enter 2nd record I want data in field A (By default)should be same as data of 1st record of D field. can anyone help??? Even if its possible that i create Form from query and update data from there and when i add new record "Textfield of A" picks previous data of D and then I update it

Sandip

Reply With Quote
  #2  
Old December 11th, 2003, 06:08 PM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
Sandip,

A solution can be the following:

Create a button 'new record' on your form and insert the following code into its OnClick event handler:
(I suppose both values are numeric.)

dim lngValueToPass as long 'declare a variable to store the data to pass to the new record
lngValueToPass=D 'assign the value of field 'D' to this variable
docmd.gotorecord , , acnewrec 'go to the new record
A=lngValueToPass 'assign the value stored in lngValueToPass to field 'A'

BRegs,

TBÁrpi
__________________
BRegs,
TBÁrpi
"I can only show you the door. You're the one who has to walk through it."

Reply With Quote
  #3  
Old December 12th, 2003, 10:37 AM
sandipt sandipt is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 14 sandipt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Add Previous Record in Next record

Hi
TBArpi
Thanks I will try this but I am not good in coding but will try. But is it possible to post sample database here or can e mail me the same so i will understand better.
Thanks again
Sandip

Reply With Quote
  #4  
Old December 12th, 2003, 11:16 AM
TBÁrpi's Avatar
TBÁrpi TBÁrpi is offline
Lazy User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Hungary, Europe
Posts: 337 TBÁrpi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 5 m 5 sec
Reputation Power: 5
Send a message via MSN to TBÁrpi Send a message via Yahoo to TBÁrpi Send a message via Skype to TBÁrpi
Generally, which the sample does when you click on Add New button is:
Captures the value of the last record's D field and passes it to the new record's A field.
Play with it.
Attached Files
File Type: zip sandipt.zip (25.7 KB, 423 views)

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Add Previous record in Next Record


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway