Create new record in different table?

G

Guest

I have a table called Referrals. I need to add a button to that form to
allow users to add records to table called Deferred. Records in the Deferred
table must have a record in a table called Donors. My problem is when that
relationship does not exist yet.

I figured out how to check to see if there's a matching record in the Donor
table but what I can't figure out is how to create the record if it's not
there. I need to create a new record in the Donors table and fill in one
field. The problem is that the Donors table is not open at this point - the
form the user is in is based on the Referrals table. Is there a way to
create a record in a table that isn't open?
 
C

Carl Rapson

Sure, use something like this:

DoCmd.RunSQL "INSERT INTO [Donors] ([field]) VALUES ('value');"

Carl Rapson
 

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