[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Problem with Update Error '3144'

Posted on 2008-10-10
2
Medium Priority
?
457 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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month18 days, 20 hours left to enroll

834 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