|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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." |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
||||
|
||||
|
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. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Add Previous record in Next Record |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|