Results 1 to 11 of 11
  1. #1
    Join Date
    Jul 2009
    Posts
    6

    Unanswered: query prompts for parameters when i have none?

    A preface: I am VERY new to access (as in, only a few days of teaching myself w/o books), and I am running on access 2000.

    Background:
    I have a form for employees to enter daily time information for a timesheet report to be printed. Since I don't want employees accidentally overwriting other's information, I have the form locked to only allow adding new records. If they need to edit information for a day, I included a button which opens a pop up form for them to input their first name, last name, and date that they want to edit. When they press the button, a macro runs that filters the form (using a query, not a filter) to show only that record and closes the pop up form.

    the problem:
    but, when i try to run the macro, parameter boxes pop up asking for first name and last name again. i don't ask for parameters in the query, so why are these here and how do i get rid of them? (in the query, the criteria i am using are [Forms]![filter form]![First Name],[Forms]![filter form]![Last Name], and [Forms]![filter form]![filter date])

    thanks

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Don't close the calling form. If it's closed, forms!formName!formValue is unavailable.

    You could also be trying to catch a red herring. What does the full query look like?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Jul 2009
    Posts
    6
    I put the output all fields to Yes, since i wanted it to populate all the fields on my form. The only columns showing in the query design view are ts_Date, with the criteria ([Forms]![filter form]![filter date]), e_F_Name, and e_L_Name with the corresponding criteria. If I put in the information to the additional parameter values that pop up, it works like i want it to.

    Also, I took the part of the macro that closed the pop up out as you suggested and it still closes when I run it?

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What does the full query look like? The SQL itself?

    What are you prompted for?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Jul 2009
    Posts
    6
    SELECT TimeSheet.ts_Date, Employees.e_F_Name, Employees.e_L_Name, *
    FROM Employees INNER JOIN TimeSheet ON Employees.e_ID=TimeSheet.ts_Employee
    WHERE (((TimeSheet.ts_Date)=Forms![filter form]![filter date]) And ((Employees.e_F_Name)=Forms![filter form]![First Name]) And ((Employees.e_L_Name)=Forms![filter form]![Last Name]));


    the prompts ask for "Employees.e_F_Name" and "Employees.e_L_Name" (no quotes).

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I figured. You're searching for a red herring. Access is having no problems resolving your form controls.

    What happens when you run this?

    SELECT Employees.e_F_Name, Employees.e_L_Name
    FROM Employees
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Jul 2009
    Posts
    6
    it brings up the information from the employee tables no problem. the problem is that doesn't have the information i need for the timesheet, that has to come from the timesheet table. maybe if i show how my tables are set up you can help me understand how to make this work better

    Employees-AutoNumber(PK), First Name, Last Name, Salary, Start Date, Employee Type, Service Site

    TimeSheet-Date, Employee (combo box, linked to autonumber, First Name, and Last Name in Employees table), Start Time, End Time, Lunch Break, Service Start, Service End)

    so how do i do this so im not searching for a red herring?

  8. #8
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Perplexing.

    Would you mind taking a screen shot of the prompt dialog you get?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  9. #9
    Join Date
    Jul 2009
    Posts
    6
    here they are
    Attached Thumbnails Attached Thumbnails parameter pop up.JPG   parameter pop up 2.JPG  

  10. #10
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Ok, I'm pretty sure it would prompt you for Forms![filter form]![First Name] if it was unable to resolve your form reference. I'm fairly confident that it's having a problem resolving your field names from within your table.

    Can you give this a go?

    SELECT TimeSheet.ts_Date, Employees.e_F_Name, Employees.e_L_Name, *
    FROM Employees INNER JOIN TimeSheet ON Employees.e_ID=TimeSheet.ts_Employee
    WHERE (((TimeSheet.ts_Date)=Forms![filter form]![filter date]) And ((Employees.e_F_Name)="ValidFirstNameGoesHere") And ((Employees.e_L_Name)="ValidLastNameGoesHere"));



    If my hunch is correct, you should still get prompted for your parameter names because it still won't know what Employees.e_F_Name or e._L_Name are. If incorrect, I need to figure that out sooner than later so I can stop giving you bad advice...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  11. #11
    Join Date
    Jul 2009
    Posts
    6
    haha =)

    just to clarify, am i supposed to type the names into the ""s?

    not sure if it even matters though, because no matter whats in the ""s it still gives the same prompts with "Jane" "Doe" and "ValidFirstNameGoesHere" "ValidLastNameGoesHere".

Posting Permissions

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