Solved

Problem with Update Error '3144'

Posted on 2008-10-10
2
449 Views
Last Modified: 2010-04-21
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~
0
Comment
Question by:DonGarry
2 Comments
 
LVL 7

Accepted Solution

by:
shambalad earned 500 total points
ID: 22690408
try this:
 DoCmd.RunSQL "UPDATE VehicleEquip SET VehicleEquip." & strFieldName & "  = False;"
0
 

Author Closing Comment

by:DonGarry
ID: 31505164
Thank you so much, i thought i tryed that one but apparently not!

thanks again!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question