DonGarry
asked on
Problem with Update Error '3144'
I Cannot find the correct syntax to fix the problem i'm having. i'm using a update query to change a variable. The strFieldName is the field name A1 throught A80.
Dim txtName As String
Dim strFieldName As String
txtName = Me.txtSelectedText1.Contro lSource
strFieldName = Mid(txtName, 4, 3)
DoCmd.RunSQL "UPDATE VehicleEquip SET VehicleEquip.( " & strFieldName & " ) = False;"
the code works if there is a spacific field (eg."UPDATE VehicleEquip SET VehicleEquip.A41 = False;")
but i need it to work for all of them.
i'm aware that i can create a recordset and then loop through them, but this seemed easier, although now its not.....
thanks
~B~
Dim txtName As String
Dim strFieldName As String
txtName = Me.txtSelectedText1.Contro
strFieldName = Mid(txtName, 4, 3)
DoCmd.RunSQL "UPDATE VehicleEquip SET VehicleEquip.( " & strFieldName & " ) = False;"
the code works if there is a spacific field (eg."UPDATE VehicleEquip SET VehicleEquip.A41 = False;")
but i need it to work for all of them.
i'm aware that i can create a recordset and then loop through them, but this seemed easier, although now its not.....
thanks
~B~
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks again!