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

Link two forms

Status
Not open for further replies.

mauricionava

Programmer
Jul 8, 2005
209
US
I know I have asked this before.

I need to link to forms. The specs are
The main form's table has a AutoNumber as the ID field and has about 3500 records. Other form's table has an AutoNumber also as the ID field and is empty, it has no records (new table).

When I use the wizard to open a form in the Main form, it asks me for matching field which it would be the ID but how would they match their fields if one table is empty?

How can I work this out?

I created this new form to open it from the main form to enter the References of the current customer in the mian form.

Thanks in advance
 
Ok, tha thing is that I do not have more space in the main form, I do not want it to be larger.

I though of set it visible = no and a button in my main form to set it as visible and then a button in the subform to set it invisible.

any other suggestions?

thanks
 
Ok, so, let me get this straight.

You have a main form.
You have a second form, with foreign key of the Main Form ID.
You have a button on the main form that opens the 2nd form and shows only the related records (based on the ID).

Right?

What is the code behind your button?
What is the recordsource of the 2nd form?

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
ok,
You have a main form.
You have a second form, with foreign key of the Main Form ID.
You have a button on the main form that opens the 2nd form and shows only the related records (based on the ID).

That's all right but the fact that when I press the button to open the second form it does not show the records related to the record in the main form and that what I'm tying to get.
 
I've got to link them finally.

I created an Append query with the two fields that need to be linked and a macro settings the warning off and then running the query. The macro is ran under the command button that opens the second form.

I inserted an If statement checking if the ID is already in the second table to not run the macro, if it's not, then run it to create the new record.

Thanks.
 
well there is this nice and simple control that is called tabs you can add the tab control to the main form and then post all the sub forms on the tab control
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top