Populating a form on data entry

K

Kevin Smith

I have a form that draws data from a number of tables to display, my
problem is this, I have a USERID field which is a primary key for the
main table, when i enter a new record I want it to populate with the
details of an older record if the USERID I enter is already in use in
the database.

So the effect is thus, I open the form to enter new details and I
enter a duplicate USERID and it populates the rest of the form at that
point with the information for that person. At the moment it lets me
go all the way through and then at the end tells me I cannot create a
duplicate entry because USERID is a primary key.

Any help would be very gratefully recieved :)

Regards

Kevin
 
A

Arvin Meyer

It sounds like you'd benefit from a subform. Both forms will have the
UserID, the subform will populate the UserID field automatically if it's
used as a linking field between the form and its subform. Take a look at the
Northwind sample database that came with Access. The Orders form and subform
should be a good example to learn from.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

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