Results 1 to 14 of 14
  1. #1
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56

    Form not passing data to query

    Help, I have a simple form. 1 Field "NCR Number" and a Button to execute the report. I Enter a valid number and it calls a report speceifc to that number.


    Problem is that it pops up the query asking for the number. Enter the number again then it works.

    What am I doing wrong?



    Bob

  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,640
    Likely you've misspelled the field name either in the query or in your code (which you didn't post). It needs to match exactly.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    Checked that. I copied and pasted to make sure.

    I know I am doing something wrong..

  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,640
    The parameter prompt is Access telling you "I don't know what this is". You still haven't posted your code or the SQL of the query. You have a space in the name above. Presuming that's really the field name, is it bracketed as it would need to be?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    Ok again I ma new to Access so here is what I have. I think this is what you were looking for??

    Command to open unbound form

    Private Sub Command142_Click()

    DoCmd.OpenForm "1form"
    End Sub


    1Form "Name of Form"

    1 Field called text0
    1 Button with the following code

    Private Sub Command2_Click()
    On Error GoTo Err_Command9_Click

    Dim stDocName As String

    stDocName = "1"
    DoCmd.OpenReport stDocName, acPreview

    Exit_Command9_Click:
    Exit Sub

    Err_Command9_Click:
    MsgBox " Oops Need Input "
    Resume Exit_Command9_Click
    End Sub


    Query Criertia

    Linked to NCRNumber
    [Forms]![Non-Conformance Form]![NCRNumber]

  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,640
    Is this form open when the report opens?

    [Non-Conformance Form]

    If so, can you post the db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    Here is a screen shot.
    Highlighted Account Tab calls the Main Form
    When I add a valid Account # and Click the Button

    I would upload it but it has sensitive data.
    I do not know how to clear data without deleterious the tables.

    Enter Parameter Value ends up.

    Nothing else is open

    Bob

  8. #8
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    Sorry forgot to attach the file


  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    I assume when you say nothing else is open that the named form isn't open. The form named in the query must be open when the query/report runs.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    That is correct. In my mind it should work but thats not saying much..

    Bob

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    The query won't open the form for you. It must already be open.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    Ok I am confused.


    The form calls the report. In the Report it is linked to the query is that what you mean?

    Bob

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Can you post a copy of the db without the tables in it so there's no sensitive data?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #14
    bobfin is offline Advanced Beginner
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2010
    Location
    https://t.me/pump_upp
    Posts
    56
    I figured it out. It was my query it was point to the wrong table.

    Thanks,

    Bob

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

Similar Threads

  1. Passing a form name to a subroutine
    By trb5016 in forum Programming
    Replies: 0
    Last Post: 02-01-2010, 12:03 PM
  2. Passing Data with OpenForm
    By nkenney in forum Forms
    Replies: 1
    Last Post: 10-26-2009, 11:40 AM
  3. Passing Parameters to a Data Access Page
    By stevie6410 in forum Access
    Replies: 0
    Last Post: 10-01-2009, 09:14 AM
  4. Passing data to sequential form fields
    By jeepfamilyva in forum Forms
    Replies: 0
    Last Post: 06-28-2009, 11:04 AM
  5. Passing a variable to a form
    By cjamps in forum Forms
    Replies: 0
    Last Post: 03-02-2009, 05:32 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