Results 1 to 6 of 6
  1. #1
    crimedog is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2013
    Posts
    141

    Query Criteria from FOrm Text Box Error

    I have Query set up - I ran the query to make sure it works


    I used 19 as criteria for RepID (field in query) and it works
    I have a form the returns the RepId in a text field - I used [forms]![FrmRepID]![TxtRepID] as criteria (to reference the textbox - it works

    I went through and did a lot of edits

    It stopped working

    So I erased the criteria - Query works
    Typed in 19 Query works
    Checked the form - TextBox has 19 in it
    used [forms]![FrmRepID]![TxtRepID] & ran the query

    I get MessageBox "Enter Parameter Value Forms_4D0C9D4FF74665AF9348261614D2BB.TxtREPID "
    What am I doing wrong?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    very odd.
    if your box is named TxtRepID, and is in form FrmRepID, then it will run.
    mine run every day like this.
    this may be corruption.

    did you try compact/repair?
    is the form open (an not in design mode) when you run the query?



  3. #3
    crimedog is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2013
    Posts
    141
    Box is TxtRepID form is FrmRepID - form is Open
    The form gets the RepID from a query QryRepLoggedIn, the QryRepLoggedIn gets the RepID from a Table where the ID is Primary Key & AutoNumber

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Agree with ranman, sounds like corruption.

    Delete the form.
    Compact and Repair.
    Close Access.
    Restart Access
    Create the form again.

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    From your description, it does indeed sound like corruption in your form....not your data.
    Whilst it may be necessary to delete and re-create your form as Steve suggested, try the following first to fix any corruption in code.

    First backup then decompile followed by compile (and fix any errors) then compact.
    If you have never decompiled, you can read about it at http://www.fmsinc.com/microsoftacces.../Decompile.asp.
    It only takes a few seconds and may save you a lot of work
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    crimedog is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2013
    Posts
    141
    So - for the Query, If I remove a specific table the error goes away - if I show a specific table it comes back
    I guess it is a bad join

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

Similar Threads

  1. Updating text box in form used as query criteria
    By jmwebster91 in forum Forms
    Replies: 6
    Last Post: 06-20-2016, 09:37 AM
  2. Replies: 2
    Last Post: 07-01-2015, 11:39 AM
  3. Replies: 14
    Last Post: 03-31-2015, 05:20 PM
  4. Replies: 2
    Last Post: 07-09-2014, 12:43 PM
  5. Replies: 2
    Last Post: 06-22-2014, 09:49 PM

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