using 2 forms

jrb187
11-14-2000, 06:31 PM
Hi I'm new to VB but have experience in QBasic. I am developing a database program to keep track of the members of our church using Access97 as my database. I have Form1 and Form2. Both Forms use the same database but have 2 different data controls. On Form1 I enter the name, address etc and on Form2 I enter the family tree info, children etc. I have no problem with adding new records, advancing to next record or previous record. I can search for a new record OK. My problem is when I search a new record the Form1 shows the proper info but Form2 shows the original info that was on the form before I searched. I need Form2 to have to info that goes with the new record on Form1 that I searched for. Please explain this as simple as possible as I am not that familiar with VB. I appreciate your rely,
Thanks, newvbr

Fredr27
11-15-2000, 12:01 PM
High!

When moving to an other record in a datacontrol an event is fired called Reposition. When this event is fired you want to move to the same record in the other datacontrol.
This sample might help you.

Private Sub Data1_Reposition()
form2.Data2.Recordset.MoveFirst
Do Until form2.Data2.Recordset("VALUE") = Data1.Recordset("VALUE")
form2.Data2.Recordset.MoveNext
Loop

End Sub

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum