Can't believe how out of touch I am with Access

J

JJurek

Ok. I know I have done this before but its been a few years.

I have a form, it has a tab control. On the first tab I have it named
"Configure"

This page has on it 3 text boxes unbound and one button (Add Record)

There is a second set of two text boxes, unbound and one button (Add Record)

How do I associate the 3 boxes to the first button and the second 2 boxes to
the second button to allow me to add records to two different tables?

Thoughts? Ideas?

-J
 
T

Tom van Stiphout

On Thu, 23 Jul 2009 09:05:01 -0700, JJurek

Treat each set separately.
For the first set you create an append query that takes 3 parameters.
You call it with code like this:
dim qd as dao.querydef
set qd=currentdb.querydefs("myFirstAppendQuery")
qd!myFirstParameter = Me.myFirstTextbox
qd!mySecondParameter = Me.mySecondTextbox
qd!myThirdParameter = Me.myThirdTextbox
qd.Execute dbFailOnError
qd.close
set qd=nothing

Then create a second append query, and feed it the other three values.

-Tom.
Microsoft Access MVP
 
J

JJurek

Tom,

An interesting new wrinkle has appeared.

When I add in the code as you suggested, I get 12 entries
all exactly the same as what I have in the text boxes. Before running
the append query, I have exactly 12 records already in the table.

Is it writing one out for each entry already exisisting?

-J
 
J

JJurek

Correction, that IS what it is doing. It is writing a record out for each
record that already exists
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top