Error 3079 Specified field could refer to more than one table

ikzouhetnietweten

Registered User.
Local time
Today, 20:37
Joined
Oct 23, 2015
Messages
44
When I click on a Lastname in the Navigationform I get this error:

Specified field 'klantnaam' could refer to more than one table listed in the FROM clause of your SQL statement.

Probably because my form is based on a query that has two tables with Klantnaam in it. But they are all the same. I just want the form to open of that Last name and that Klantnaam based on that query. How do I do that? I need it to look for two criteria: Klantnaam and LastName.

File is attached.

Code:
Code:
Private Sub LastName_Click()
DoCmd.OpenForm FormName:="KlantenDetailswijzigen", WhereCondition:="Klantnaam = '" & Me.Klantnaam & "' AND LastName = '" & Me.LastName & "'"
End Sub
 

Attachments

you need to put the table name (by the sound of it, either table) in front of 'Klantnaam ='

WhereCondition:="sometable.Klantnaam = '"....
 
Ah yes your right, its working now, thank you =) +rep
 

Users who are viewing this thread

Back
Top Bottom