Results 1 to 6 of 6

Query Criteria from FOrm Text Box Error

  1. #1
    crimedog is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2013
    Posts
    125

    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 online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    6,961
    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
    125
    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
    7,799
    Agree with ranman, sounds like corruption.

    Delete the form.
    Compact and Repair.
    Close Access.
    Restart Access
    Create the form again.
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

  5. #5
    ridders52's Avatar
    ridders52 is offline Voodoo Is Practised
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    2,477
    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 (Mendip Data Systems), Website, email
    If this has helped, please click the star button and leave a comment

  6. #6
    crimedog is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Dec 2013
    Posts
    125
    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, 08:37 AM
  2. Replies: 2
    Last Post: 07-01-2015, 10:39 AM
  3. Replies: 14
    Last Post: 03-31-2015, 04:20 PM
  4. Replies: 2
    Last Post: 07-09-2014, 11:43 AM
  5. Replies: 2
    Last Post: 06-22-2014, 08: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
  •  
Tech Forums: Microsoft Office Forums