add data to the same record in 2 forms

G

Guest

I am working on a Access 2003 database, I have 2 forms for the users to enter
data in. The data on both forms applies to the same record. The primary key
is autonumber.
I have tried to pass the primary key to the second form in a text box by
using the SetValue command in a macro, but it keeps creating a new record
each time.
Could anyone give me some help?
 
D

Dave M

There may be more to this than meets my eye, but if you have two forms that
are based on the same table, adding a record to one should make it available
in the other, unless the forms are filtered in some way that it gets
suppressed. If the second form is open when the record is added to the
first, you may need to requery the second form to get the record to show up.
 
J

John Vinson

I am working on a Access 2003 database, I have 2 forms for the users to enter
data in. The data on both forms applies to the same record. The primary key
is autonumber.
I have tried to pass the primary key to the second form in a text box by
using the SetValue command in a macro, but it keeps creating a new record
each time.
Could anyone give me some help?

Why *TWO FORMS*? They'll conflict, if they're both open at the same
time; you cannot have Access editing the same record in two different
forms. And you cannot (as you have seen) edit an Autonumber value
using SetValue or in any other way.

Could you explain the business need for the two separate forms? I
suspect that one form with two tab pages, or a Form and Subform would
be a better solution. It's possible to open a second form and have it
go to a specific record, but doing so will run into the conflict
problem above.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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