I'm trying to run some SQL commands in Access VBA to update the blank (null) fields in a column with the value obtained from a combobox in the form.
At the moment I'm receiving
Run time Error '3061' Too Few Parameters. Expected 1
but it appears to be properly formed.
The code I'm using is below. User will be passed as a string, e.g. - "Joe Bloggs".
Public Sub testSub(user as string)
Dim db as DAO.Database
Dim sqlstr as String
set db as CurrentDB
sqlstr = "UPDATE tTable1 SET Field1 = [" & user & "] WHERE Field1 IS NULL;"
db.Execute sqlstr
End Sub
Jim O'Shea