Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2009
    Posts
    14

    Unanswered: Help With Using QBF!

    First time poster and still green with using MSAccess 2003.

    OBJECTIVE: To create a form that pulls records between 2 date ranges for a certain employee.

    FORM FIELDS: Start Date, End Date, Manager Name

    TABLE: Is pulling data from a SharePoint site. The table has a column called 'Submited On' which identifies the date and Managers Name which (of course) identifies the Managers name.

    PROBLEM: How do I do this? I think I've got the form and macro built correctly, it's just the criteria in the query that I'm having a pickle with. Any help would be wicked awesome. Thanks!

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Welcome to dbforums.

    Please supply some precise information such as: name and definition of the table(s) in use, code and/or description of the objects (queries, forms ...) you already have, problem you encounter etc., thanks.

    The more specific and precise you are, the more you have chances of getting a quick and accurate answer.

    Have a nice day!

  3. #3
    Join Date
    Aug 2009
    Posts
    14
    I've created a form following the instructions posted at How to use the Query by Form (QBF) technique in Access 2000. What I'm looking for is how to modify it so that:

    (A) it pulls records between two dates (ie: from the column in my table called 'Submitted on')

    (B) pulls records based on a specific name (ie: from the column in my table called 'Manager's Name')

    (C) kicks everything out into a report

    Clear as mud?

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    strSQL = "SELECT ... " & _
    "FROM ... " & _
    "WHERE ([Manager's Name] = '" & ManagersName & "') AND " & _
    "([Submitted on] Between #" & StartDate & "# AND #" & EndDate & "#)"

    Have a nice day!

  5. #5
    Join Date
    Aug 2009
    Posts
    14
    Okay...I'm not getting it at all. This is what my SQL code looks like:

    SELECT [MBI Submission Form (Client Services)].ID, [MBI Submission Form (Client Services)].[MBI submitted on], [MBI Submission Form (Client Services)].[MBI Status], [MBI Submission Form (Client Services)].[Business Impact], [MBI Submission Form (Client Services)].[Description of the problem], [MBI Submission Form (Client Services)].[Describe the potential solution]
    FROM [MBI Submission Form (Client Services)]
    ORDER BY [MBI Submission Form (Client Services)].ID, [MBI Submission Form (Client Services)].[MBI submitted on];

    When I plunk in your code, I get an error message saying there is something wrong with the syntax?

  6. #6
    Join Date
    Aug 2009
    Posts
    14
    Sorry... this is my SQL code:

    SELECT [MBI Submission Form (Client Services)].ID, [MBI Submission Form (Client Services)].[MBI submitted on], [MBI Submission Form (Client Services)].[MBI Status], [MBI Submission Form (Client Services)].[Business Impact], [MBI Submission Form (Client Services)].[Description of the problem], [MBI Submission Form (Client Services)].[Describe the potential solution]
    FROM [MBI Submission Form (Client Services)]
    WHERE ([Manager's Name] = '" & ManagersName & "') AND " & _"([Submitted on] Between #" & StartDate & "# AND #" & EndDate & "#)
    ORDER BY [MBI Submission Form (Client Services)].ID, [MBI Submission Form (Client Services)].[MBI submitted on];

    And this is the error I get:

    Invalid use of '.', '!', or '()' in query expression '[Manager's Name...'

    What am I doing wrong (probably a lot of things!)?

  7. #7
    Join Date
    Aug 2009
    Posts
    14

    Screen Shots

    Hope this works. Here are some screen shots of my DB...

    DB Screen Shots.doc

Posting Permissions

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