Solved

Problem with Update Error '3144'

Posted on 2008-10-10
2
451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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 …

726 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