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

linking controls in form

Status
Not open for further replies.

becshu

Technical User
Jan 28, 2003
18
US
Hi,
I have a multi-page form that links several tables. The tables are related by an ID number. One the first page of my form, the ID number is auto-entered for the first table, then when data is added to each additional page/table the ID number is automatically updated to what it is on the first page. However, if I don't add data to a certain page, the ID number for that table does not get added and when I try to add data later for that table (through the form) I get an error. I thought I could get around this by automatically entering the ID number for every page once the ID number has been entered on the first page but am not having any luck making this work. Does anyone have any ideas?? I tried using some "before_update" commands, and other things like that, but nothing seems to be working. Help!!
 
When you say the tables are related by ID number, did you use the Relationships tool to formalize the relationships?
 
Yes, they are related in the relationships table as well as using the initial table's id as a control source for the other tables' ids.
 
Did you try turn on referential integrity and cascading updates for your tables ?
 
I tried enforcing referential integrity and it seems to work occassionally but not always. I keep getting an error that I can't add to a second table because the first table doesn't include a comparable value in the related field, but that's not the case. I'm completely baffled. I think one way around this problem would be to automatically enter the ID value of the first table into all consecutive tables (which are all included on this one form) but I'm not succeeding in doing this. I'm used to working with forms and VB in excel where this would be very simple, but I can't figure it out here. Any tips would be appreciated! Thanks.
 
You would have to code it in ADO. Any experience there?
 
Nope. Not that I know of.:) I have lots of experience using VB, macros, and forms with Excel, but this is my first real project in Access. Is ADO something that is often useful when programming Access projects? If so, is there a book or site you would recommend where I can pick up the basics? If not, I'll try to find another way to go about my project. Thanks!
 
I've decided to give subforms a try. I think this will fix my problem. Thanks for your help!
 
Sorry, thought you were using subforms. They should work fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top