Link to home
Start Free TrialLog in
Avatar of DonGarry
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.ControlSource
        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
Avatar of shambalad
shambalad
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DonGarry
DonGarry

ASKER

Thank you so much, i thought i tryed that one but apparently not!

thanks again!