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

Duplicate record in form

Status
Not open for further replies.

DajOne

Technical User
Jun 11, 2002
146
CA
I have looked at many possible solutions in this forum however I am missing something. I am not very experienced so I am sorry if this is not clear.

table : main
Key field : contract
Other fields: Client name, date entered,

table : sub
linked field : contract
Other fields: message,


The form has a combo box in the form header which lists the main!contract entries. The form header also has a 'add record' button' for the user to use if the entry is not found in the combo box.

The main!fields are in the detail portion of the form.
The sub!fields are in a subform.

Everything works fine until a user clicks on 'Add record' button and enters an existing [contract] (which is the key field, table set at no duplicates).

I would want that when the user enters an existing [contract], that the corresponding data shows up in the rest of the fields instead of having the error message pop up. For the moment, only the data in the sub form appears.

I understand that the usual way would be to have a error message appear butI fear that is too comlex for me.

Although helpful, is not what I am looking for.

Thanks in advance for the help..
 
If I understand correctly, if a user types a already existing name in the (bound) textbox, it should display that entry.

For starters (part 1), you need the code TheAceman1 gave to trigger a response (including the CANCEL = TRUE).
Then (part 2) you can set a filter to filter out the name that is already in the table... First try to get the part 1 working (DLOOKUP etc..)





Pampers [afro]
Keeping it simple can be complicated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top