Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jul 2004
    Posts
    67

    Unanswered: need help w/ #name? errors on form

    I have a form (under construction) that is based on a query. The query works well and has no errors. I can effectively input data through the query.

    The form, however, has numerous #name? errors in textboxes. The textboxes with errors don't seem any different to me then those without errors. All fields with errors are taken directly from the drop-down list of fields from the source query. Those fields even have data in them when viewed directly through the query.

    A snapshot of the form is attached. Any thoughts on why those fields have errors would be appreciated. I need to resolve this quickly.

    Thanks in advance,
    David
    Attached Thumbnails Attached Thumbnails screenshot-name err.jpg  

  2. #2
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    are #name fields calculated fields? or do they have any kind of default value?
    ghozy.

  3. #3
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    If you could include a sample database I could probably find what is wrong. The only thing I can suggest is the fact that you have an invalid name of something somewhere. If it is a calculated field one of the calculations is probably wrong, which is where I think ghozy was going.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  4. #4
    Join Date
    Jul 2004
    Posts
    67

    sample DB

    None of the #name fields are calculated. The #error fields are calculated, but they're explained by the other errors.

    Here's the sample DB. Thanks for taking a look!
    Attached Files Attached Files

  5. #5
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    ok on my first look when I run the query it doesnt show the fields that you selected in the query design. which in the form same fields shows #name
    Edit: I might be wrong.
    Last edited by ghozy; 08-12-04 at 21:15. Reason: correction
    ghozy.

  6. #6
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    I will tell you something more weird. when open your forms control source query in form's design mode and cahnge something and reverse changes back. then save back. #names error disapears. I will add database file back so you can check. it is magicaly fixed itself.
    Attached Files Attached Files
    ghozy.

  7. #7
    Join Date
    Nov 2003
    Location
    San Francisco, CA USA
    Posts
    59

    Very weird

    I noticed that the tlkpAirlines table was missing so I put that in in case something hinky was happening. Everything looks fine and that didn't help at all.

    I was able to recreate your problem exactly. I didn't see anything else "wrong" with your form but I noticed I could "fix" it if I did this.

    Go into design mode in your form.
    Go to the properties window and click the Data tab.
    Click in the field with the datasource name (the query) and then click the little button to the right that appears in order to launch the query.
    When the QBE grid (the design window) shows up, press the Exclamation mark to run the query.
    Close the query window.
    Save your form.
    Open it up again.

    It seems to "find" the fields once you run the query from inside the form.
    I found that once I did that, the #Name fields all behaved. If I saved the form, exited the database and went back in, it still worked fine.

    Strange. And Good luck.

    Magee

  8. #8
    Join Date
    Jul 2004
    Posts
    67

    Unhappy Still weirder

    Thanks for your replies. I tried to replicate each of your 'magical' fixes and neither worked.

    Perhaps you can look again and try to find the 'hidden' problem.

    THANKS!

  9. #9
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    did you try the file I sent? it is a working version of your database.
    ghozy.

  10. #10
    Join Date
    Jul 2004
    Posts
    67

    narrowed it down

    OK everyone...I've narrowed down the problem to the VB code behind the form. When I change the form's 'has module' property to NO, then the #name? errors disappear.

    I'd like your help in identifying the problem, and I can post the sample DB with the code behind it, but you'll need the other tables for the code to make sense. However, I'm reluctant to publicly post the entire DB.

    Any suggestions?

    Thanks again,
    David

  11. #11
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    I can't think anything else about this problem. I believe it is a field reference problem. try this:
    * choose another query for your form's record source. save it.
    *open it back and change it back to old query. save it.
    * try it.
    ghozy.

  12. #12
    Join Date
    Jul 2004
    Posts
    67

    Thumbs down nope!

    No, didn't work.

  13. #13
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    make another form with wizard based on the same query? and lets see if it working?
    ghozy.

  14. #14
    Join Date
    Jul 2004
    Posts
    67

    Smile Figured It Out!!!

    I figured it out...I have a Command Button in the footer called cmdClear. Here is the code behind its Click event:

    Code:
    Public Sub cmdClear_Click()
    
    'Clear other search fields
    Me.cboPassengerLookup = ""
    Me.cboRunNumLookup = ""
    
    'Clear filters and go to new record
    varSQL = "SELECT * FROM tblRuns"
    Forms![frmReservations].RecordSource = varSQL
    DoCmd.GoToRecord , , acNewRec
    
    'Move focus to RunDate field
    [dtmRunDate].SetFocus
    
    End Sub
    The problem with this is that I STUPIDLY reset the dataset to tblRuns instead of qryReservations.

    The reason this caused a problem immediately upon using the form is my GENIUS PLACEMENT of a call for that Sub in the form's Open event.

    So, everytime the form opened, the comand buitton was being procedurally 'clikced' and was changing the data source!!!

    Anyway, hope y'all learn from my mistakes!

    Thanks for the input!
    David

  15. #15
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    hehehe, well I'm glad you figured it out, I was out of ideas.
    ghozy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •