I had this same problem, and many things I tried, as well as many suggestions, failed. Finally, blarson0 found the solution to my problem, and based on that, I think the following should help you:
Put the same control on all five forms, something like
record_id. It should be something that only has one value per record. If the user inputs this value, then you can have them do that on the first form, and on all the others, put a text box with
record_id as the control source, and set them to invisible, or not enabled, depending on how you want them to act.
Now, in your properties window (press {F4} or double-click something on the form if it's not open), go up to the list box at the top, and find the name of your tab control, which should be something like
TabCtrl0
or
tab_control0 or something similar. Set its
on change event to
event procedure.
Now, in the Visual Basic code, put something similar to this in:
Code:
.Value = 1 Then
Me.Form.RecordSource = "SELECT * FROM [
Code:
.Pages(0).Controls!Form.Controls!
Code:
& "' );"
Else
...
EndIf
Change
to the name of your tab control, and change
to the name the table you have
stored in.
The preceding code checks to see which tab you've entered when you change tabs, and whatever record is open on the first page, it will open on the second. Just repeat this code in the if statement for each tab where you want to load records based on the other tabs. I've discovered that tab control pages are really annoying. So this may not even work for you.. the version I have has various subforms on each page, so I had to set the RecordSources on each of those according to the subforms. But it should be basically the same if you just have main forms on each tab page. Also, the tabs are numbered so that
pages(0) is the first one on the left,
pages(1) is the one after that, etc.
I hope this is helpful! To see the process I went through and the different things I tried (maybe something in there will work better for you than it did for me), go to thread702-327263
47 is a magical number. 47 plus 2 equals 49. 47 times 2 equals 94. 49 and 94. 94 and 49. Relationship between 47 and 2: it's magic.