Results 1 to 10 of 10
  1. #1
    Voodeux2014 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Nov 2014
    Location
    Slidell, LA
    Posts
    130

    Question Update Query Issue


    I have an update query in place that pulls the current device shown on my frmMainMenu and sets that as the current device. I want it to pull the information in a textbox on frmDevNameChange and have it change that devices name in the table so that the frmMainMenu will then display the new name. Problem is, it keeps saying that the textbox on frmDevNameChange isn't recognized. I can get it to work by putting the val option in front, but then it just sets a number. Any help would be appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is that form open? It has to be. If it's a subform, the syntax changes:

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Voodeux2014 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Nov 2014
    Location
    Slidell, LA
    Posts
    130
    Yes, both forms (frmMainMenu and frmDeviceNameChange) are open. On frmDevNameChange I have the textbox there and have created an update query that I have linked to a button at the bottom so that it runs when that button is clicked. If I alter the query to Val([Forms]![frmDeviceNameChange]![txtNewDevName]) it will function without error, but has set the device name to a single digit number. If I set it to just the [Forms]![frmDeviceNameChange]![txtNewDevName] in the update to cell, it just gives me an error. Here is the exact error:

    The Microsoft Access database engine does not recognize 'forms]![frmDeviceNameChange]![txtNewDevName' as a valid field name or expression.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Are the incomplete brackets a typo? What is the SQL of the query?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Voodeux2014 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Nov 2014
    Location
    Slidell, LA
    Posts
    130
    UpdateQuery.zipI copied the error exactly. When I go to double check the query it has the full brackets. I don't know what you mean what the SQL of the query is. I have taken a screen shot of the query design view as well as the error.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    What I can see looks okay. Can you post the actual db here, or a sample that exhibits the error?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Voodeux2014 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Nov 2014
    Location
    Slidell, LA
    Posts
    130
    Here it is. Had to unsplit it and remove the encryption password haha.
    Attached Files Attached Files

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Subtle change, but try

    [Forms]![frmDeviceNameChange].[txtNewDeviceName]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Voodeux2014 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Nov 2014
    Location
    Slidell, LA
    Posts
    130
    Well all be, crazy how just one punctuation mark makes all the difference. Now is there a way to not have it pop up the are you sure you want to run this query pop up?

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Wasn't coming up for me. You used SetWarnings in your macro, which would be the macro way around the warnings.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 04-03-2014, 02:02 PM
  2. Replies: 1
    Last Post: 05-18-2012, 11:59 AM
  3. Update query issue
    By dastr in forum Queries
    Replies: 1
    Last Post: 03-28-2012, 04:39 AM
  4. Update query issue
    By doomy304 in forum Queries
    Replies: 2
    Last Post: 06-25-2011, 02:31 PM
  5. Update Query Performance Issue
    By Amber_1977 in forum Queries
    Replies: 2
    Last Post: 12-07-2010, 08:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums