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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms on Tab Control Design

Status
Not open for further replies.

PeterDuthie

Programmer
Mar 14, 2001
29
GB
It's a bit messy this one but I'm sure somebody must have done something like this before:

There's a main table which has (at the moment, but could have more later) two tables which hold details about the main table. These have a 1 to M relationship with the main table and we have the "enforce referential integrity" box ticked but not the other two.

I want to provide access to this db via a tab control on a form. The form is bound to the main table and subforms are going to control the data for the tables related to the main table *and* for some of the data for the main table.

It doesn't work because (as far as I can tell) the secondary forms need a reference to the main form's record ID which isn't available until the main form is closed (I think).

What would be a decent solution for this? I have some ideas about closing the main table (somehow) without closing the form - I'd really appreciate your help on this. On the otherhand if the design idea is fatally flawed I like to know ASAP so I don't waste my time and effort.

Cheers,
Peter
 
You could use a lookup combo box on the first page of the tab control, along with fields from the main form. Use subforms on subsequent pages of the tab control, setting the Link Child Fields and Link Master Fields properties appropriately.

Can't quite understand the reference to 'closing the main form'. Do that and you close the tab control and subforms.
 
You're quite right Raskew: closing the form is nonsense. All I have to do is generate number (probably by taking the highest number in the key column of the main table at start up) saving it as a global and incrementing the number everytime a new record is added. Well that's the theory - should work good I hope.

Cheers, and thanks for the prompt response,
Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top