Checking for duplicates between Access and SQL database

S

SharonInGa

Two fields, Date and Name, cannot be duplicates. The Access form and the SQL
table are set as required for these fields.

I am either getting a "Duplicate" message or a "Completed" message based on
the Access Data Err messages - but not exclusive of each other. Do I need
to query against the SQL database to see if the fields are duplicates? What
is the code to see if two key fields in a record are duplicates?


If IsNull(txtQuarter) Or Me.txtQuarter = "" Then
Me.cboQuarter.SetFocus

msgbox "Please select a Date from the list.", vbOKOnly, "Select a Date"

Else

If IsNull(txtCompositeName) Or Me.txtCompositeName = "" Then
Me.cboCompositeName.SetFocus
msgbox "Please select a Composite_Name from the list.", vbOKOnly, "Enter
Composite Name"
--------------------???
Else:

If Me.cboQuarter And Me.cboCompositeName > 1 Then
msgbox "Duplicate"
 

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