Question : Delete record in table based on selections made on form

I need to have a button on a form that will delete a record in a table that is not bound to the form. There will only be one record that matches the criteria.

Here's the code I am currently using:
CurrentDb.Execute "Delete * FROM tblZonePosition WHERE Plot = Me.Parent!SelectedPlot And Zone = Me!ZoneCurrent And Position = Me.POS011"

Here's the message I get when the code is ran:
Too few parameters. Expected 3.


Answer : Delete record in table based on selections made on form

I initially misread this:

"Zone is a number. Both plot and position are text fields."  ... 'seeing' Plot as 'number', which happened after you posted:

"I did not tell you that I need to hard code the value for Position right into the statement. The value for Position is text and needs to be POS011"  ... I accidentally Plot to number ... wherein you can see that I had Plot as text here @ http:#a25606822 ... and I was the one who asked:

"What are the Data Types of Plot, Zone and Position ?"

So, that's what happened.

mx

Random Solutions  
 
programming4us programming4us