Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I'm confused w/ code - please help - not sure how to describe problem 1

Status
Not open for further replies.

eelsar

Technical User
May 20, 2002
36
US
I created a master table with ID(autonumber)as a primary key. Then I made a few tables with ID as their primary key, and it's a foreign key to the master table. In the relationship window I connected the relationship (it's a one to one relationship)

I then created a masterform for the master table. For each of the other tables I created forms also. On the master form I created tabbed panes. On each tabbed pain I used the subform control and put the other forms on it.

I checked by the properties of the subform control that the Link Master Field and Link Child Field are correct and it is. However, the ID does not appear in the subform as it should (once I begin entering data in the master form the ID in the subform should appear). So I made a fuction on the code for each subform that it has a variable that is assigned the ID from the Master Table. In the Form_Load (and I think I put it in the wrong place)I pass the ID from the master table to the subforms. It works for the first record only, whatever the first record is. However when I press next on the data control, once again the subform ID remains zero,the code I wrote doesn't work.

Where should I place the code. I thought each time next or previous record is pressed (with the data control) that the form reloads. But I think I'm probably wrong.

If anyone knows how to help me - please respond ASAP - it will be greatly appreciated.


eelsar
 
Place your code in the 'current event'. That is the event that fires for 'each record' of the master form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top