I have a form in access. I'm using VBA to enter the values into the table.
Problem:
"Too few parameters; Expected 1;"
- I'm getting this error EVEN THOUGH THE TABLE COLUMN NAMES MATCHES WHAT IS IN THE INSERT STATEMENT.
Private Sub Command125_Click()
Dim dbsCurrent As Database
Set dbsCurrent = CurrentDb
'add data to table production_date, reason, downtime_minutes, comment , Me.Text126, Me.Text121, Me.Text123, Me.Text128
dbsCurrent.Execute " INSERT INTO tbl_Downtime " _
& "(job) VALUES " _
& "(dbsCurrent.Me.Text116);"
End Sub
End Goal:
First of all I want to fix this error. But I also need to be able to update the row based on the ID (auto-numbered in the table). How do I allow users to update the row if they know the ID of the row?
Command125
andText116
to meaningful names. This really helps the readability of your code. – Andre