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!

Making a main form and sub form both fillable? 1

Status
Not open for further replies.

ramondrumon

Programmer
Sep 5, 2002
33
US
I have two tables that are related, and I am trying to make a form with a combination of the two. I can change the information of both tables on the form of existing records all I want, but when I scroll to the last record, and go one more to make a blank form, it will only let me fill in new information on one of the tables and won't let me enter any info for the other table. I have looked at a lot of samples that do the same thing, and I don't understand why, as I thought this was the forms main function to perform. Would appreciate some help, I have worn out the search button.
 
Which one WILL it let you fill in an which one won't it - you've not been clear.

Also, you state in the title that you have a Form and SubForm - but don't express that in the main text.

If you have a table - tblMain that is bound to a form - frmMain
and you have another table tblSub that is bound to a form - frmSub
and the tblMain is one the ONE end of a One-toMany relationship with tblSub
( Eg ON tblMain.MainId = tblSub.MainRef )
On the Relationships window, make sure that this link is set to 'Maintain Referential Integrity'.

Then if you place a subForm control on frmMain and bind frmSub within that,
AND you set up the subform control's LinkParentFields and LinkChildFields properties to MainId and MainRef respectivly - then it will all work fine. You'll be able to add records to tblMain through frmMain and you'll be able to add records to tblSub through the subForm. Access will even take care of the Referential Integrity for you.



If you think that you have all of that then come back with the table structures and Record Source properties of your two forms & I'll look further.


'ope-that-'elps.

G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top