Tech Support Guy banner
Status
Not open for further replies.
1 - 10 of 10 Posts

·
Registered
Joined
·
98 Posts
Discussion Starter · #1 ·
I realise that the subject seems a bit obvious, but what I am trying to do is -

Scenario first...
I have a main form with a primary key QuoteRef which contains the details of people requesting a quotation. Each enquiry has the potential to have variations of product on the same quote e.g. storage container to buy or storage container to hire. So I have created a second table with a primary key, lets call it ContainerID and this table has QuoteRef as its foreign key linked via a one to many relationship.

The main form has a button that opens a second form based on the second table but the QuoteRef is pulled through so that the details in the second form are related to the person's details in the main form. So far so good...

What I would like is someway to add another record to this second table/form but still have it related to the person's details from the first record. I know it can be done using a sub form on the main form but I'm trying to make the actual data entry more user friendly. I tried creating a button using the wizard but this just creates an embedded macro and I can't find a way to edit it in VB.

I think I need code along the lines of

Forms![frmContainerRequirements]![QuoteRef] = Forms![frmContactDetails]![QuoteRef]

where frmContainerRequirements is the second form and frmContactDetails is the main one.

Sorry for being a bit long winded or confusing but I hope someone here can help me.
Thanks
Karen
 

·
Registered
Joined
·
21,334 Posts
The data of course would have to be added to a table as a form just displays the underlying data. Do you have a sample db you can post?
 

·
Registered
Joined
·
21,334 Posts
You could do this a couple of ways, but I just used the onLoad event for the opening form to make the QuoteRef field equal what was open on the main form.
 

Attachments

·
Registered
Joined
·
98 Posts
Discussion Starter · #8 ·
Apologies for taking so long to get back to this.
I'm not sure how using the onLoad property would work as the form is already open. You mentioned there were a couple of ways. Would you mind explaining the other one?
Thanks
Karen
 

·
Registered
Joined
·
98 Posts
Discussion Starter · #10 ·
Hi,
Sorry for the delay in replying. I've had to go back to the drawing board with this as the output from the data doesn't do what I want with Word Automation. But thanks for the help.
Karen
 
1 - 10 of 10 Posts
Status
Not open for further replies.
Top