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

Creating record in two tables on one form

Status
Not open for further replies.

grande

Programmer
Feb 14, 2005
657
CA
Hi all,

I have a table Customer, which relates to an address table. Each customer has one address. I'd like to have one form that allows the user to create their Customer and Address at the same time.

I currently have an Address field in tblCustomer. It's a lookup field based on this Row Source:

SELECT [tblAddress].[ID], [tblAddress].[AddressLine1] + ', ' + [tblAddress].[City] FROM [tblAddress] ORDER BY [AddressLine1];

This allows me to choose an existing address from a dropdown, but not create a new one (from what I can tell).

Thanks!

-------------------------
Matt Grande
C# Master.
Ruby on Rails Admirer.
ActionScript Student.
JavaScript Hate-Monger.
 
So is this impossible (or at least not recommended?)

-------------------------
Matt Grande
C# Master.
Ruby on Rails Admirer.
ActionScript Student.
JavaScript Hate-Monger.
 
You need two append queries.
The first will add a record to the customer table.
The second adds a record to the address table.


Randy
 
Have a look at the NotInList event procedure.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Turns out Access is smarter than I thought it was. I created a query that was essentially selected everything from both tables then, with the query open, hit the Create Form button. It did the rest for me.

I haven't used Access since around Access 2000, and so far Access 2010 is pretty slick.

-------------------------
Matt Grande
C# Master.
Ruby on Rails Admirer.
ActionScript Student.
JavaScript Hate-Monger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top