field auto fill from other form

DanHolland

Registered User.
Local time
Today, 12:29
Joined
Feb 6, 2013
Messages
19
Hi, i have a main customer form, then a second form with the customer sites, linked by an account reference.

is it possible to have a button on the second form (for the sites) to add a new record but to auto fill the account reference from the selected record from the main customer form (i have a button on the main form to open the information for the selected customer) been trying for ages and got nowhere. :banghead:

p.s. sorry if there's already a thread for this, couldn't find one
 
Yes, on the on button OnClick event, merelyuse VBA to store the form's control's appropriate values in the subform's appropriate control values.
 
It sounds like you need to capture the CustomerID from you main form and store that ID in a foreign key in your sites table. It then becomes a one to one or one to many relationship.

You can capture the CustomerID field by coding it in the OnClick event of a command button in your second form or in the AfterUpdate event of one of the fields say the SiteName field.
 

Users who are viewing this thread

Back
Top Bottom