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

VBA code auto assign value to related fields from several tables

Status
Not open for further replies.

skrappySenior

Technical User
Apr 10, 2007
3
US
I have one existing table of client and census data,with 119 fields. I am separating into 10 tables
tblClient; tblCensusOne....Nine

They will all have a one-to-many relationship on the tblClient.clientId & tblCenus(One..Nine).clientId (primary & foreign)field.

One to many relationship is necessary as it is updated annualy.

How can I code the tblCensusOne..Nine).clientCode[/] to automatically pickup the tblClient.clientId when entering a new client for the first time?

- I also need to have another table that creates an auto number - one-to-one relationship with the tblClient.clientId to tblClientAutoNum.clientId - this needs to happen automatically when entering a new client also - should require no user interaction
 
Provided the RelationShips are well defined in access, simply follow the form wizard to create a main form based on tblClient and linked subforms based on tblCensusXXX.
The wizard will create automatically the link properties between clientCode and clientId ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top