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

    Run-Time Error '3070': The Microsoft Office Access database engine does not recognize ...

    ERROR:


    Code:
    Run-Time Error '3070': The Microsoft Office Access database engine does not recognize 
    'Forms]![frmChangeSeatAvailability]![txtCurApprovedSeats' as a valid field name or expression.
    CODE:
    Code:
    Private Sub cmdSaveChanges_Click()    
        DoCmd.OpenQuery "aqryChangeSeatAvailability"
        DoCmd.Close acForm, "frmChangeSeatAvailability"
        Call Forms.frmMain.ClassInfoUpdate
    End Sub
    aqryChangeSeatAvailability SQL:
    Code:
    UPDATE tbl3ApprovedGrantClasses SET tbl3ApprovedGrantClasses.CurMaxApprovedSeats = [Forms]![frmChangeSeatAvailability]![txtCurApprovedSeats]
    WHERE (((tbl3ApprovedGrantClasses.ApprovedClassID)=[Forms]![frmChangeSeatAvailability]![cboClassSelection]));
    INFORMATION:
    First off, thanks for the amazing help that I get here everytime I post. I greatly appreciate it. Today I was testing the functionality of my database, as it is nearly completed (minus the fact that a database is never truly completed because the end users want new ways to do things later).

    Anyways, while stepping through all the different things that they can do and smoothing out wrinkles, I ran into one that just will not iron out for me. It has me stumped. What I am trying to do is have cmdSaveChanges initiate aqryChangeSeatAvailability that gets its data from frmChangeSeatAvailability.txtCurApprovedSeats and frmChangeSeatAvailability.cboClassSelection. However, I am getting the error shown in the title and at the top of this post.

    Thank you again, for taking the time to review my problems, even though I am sure that you have enough problems of your own, as we all do. Looking forward to receiving ya'lls feedback!
    Last edited by Voodeux2014; 01-29-2016 at 12:31 PM. Reason: layout correction

  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    What you're doing is dicey, IMHO - running a query that needs values from a form that you close in the next step. Some parts of the processing are passed around between the JET database engine, expression service and parts that I've probably never heard about. To expect a query to fully process (never mind load) before that form is closed is not something I'd do. If the query runs manually OK with the form already open, that would support my position. If it does not run, then the issue lies there. There is a discrepancy between what you posted as the message and the name of the control (missing ending ]) but I guess that's just a typo.

    You seem knowledgable enough for me to say you ought to be posting that you tried running this query and that it did or didn't run, rather than me having to suggest it since it's such a basic part of trouble shooting. In addition, if you're going to be closing forms in code from other forms, I suggest you consider whether or not it is possible that the user has already done that, lest you raise an error that might confuse them. In those cases, I always test if it exists first
    If currentproject.allforms("frmName").IsLoaded then...
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    well in this case the error message is precise. As to why it is not recognizing it - I can't say. I do note that your naming convention for the control begins with "txt.." - and I see sometimes where developers will intentionally vary the form's control name from the actual record source name by appending "txt..." it could be that you need to reference the actual record source control rather than the form control.. not sure.

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

Similar Threads

  1. access database engine does not recognize
    By slimjen in forum Forms
    Replies: 8
    Last Post: 05-30-2014, 11:53 AM
  2. Replies: 24
    Last Post: 07-08-2013, 12:59 PM
  3. Replies: 9
    Last Post: 06-08-2012, 07:52 AM
  4. Replies: 6
    Last Post: 10-30-2010, 08:42 AM
  5. Replies: 1
    Last Post: 03-02-2010, 03:01 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