Employee Phone Directory

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • startingover04
    New Member
    • Sep 2006
    • 3

    Employee Phone Directory

    I am tying to build an Employee Phone Directory and I have the form built, but I am having trouble building a query and adding a button to the form so that the staff can just put the LastName and FirstName of the employee and the form will come up with the person's name and extension number. I have tried everything I can think of and I cannot get it to work. I am fairly new to Access and I am still learning queries and macros and getting them to work right. Forms and Tables I have no problem with.
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    In your query as parameters you can add an expression like:

    Forms![MySearchForm]![FirstName]
    AND
    Forms![MySearchForm]![LastName]

    And for Macros you choose openquery command, you save the macro that open your query

    In the On Click property of your bouton you assign from the list your macro!

    :)

    Comment

    • startingover04
      New Member
      • Sep 2006
      • 3

      #3
      Thank you so very much

      Comment

      • startingover04
        New Member
        • Sep 2006
        • 3

        #4
        Originally posted by PEB
        In your query as parameters you can add an expression like:

        Forms![MySearchForm]![FirstName]
        AND
        Forms![MySearchForm]![LastName]

        And for Macros you choose openquery command, you save the macro that open your query

        In the On Click property of your bouton you assign from the list your macro!

        :)
        I tried exactly as you stated above and I keep getting an error of "invalid brackets" It adds a bracket at the beginning of 'Forms'. When I try to an ending bracket just to satify it, then I still get the error. I'm confused.

        Comment

        • PEB
          Recognized Expert Top Contributor
          • Aug 2006
          • 1418

          #5
          Originally posted by startingover04
          I tried exactly as you stated above and I keep getting an error of "invalid brackets" It adds a bracket at the beginning of 'Forms'. When I try to an ending bracket just to satify it, then I still get the error. I'm confused.
          So with the brackets try :

          [Forms]![MySearchForm]![FirstName]
          AND
          [Forms]![MySearchForm]![LastName]

          Where MySearchForm is the name of your form

          And FirstName is the name of your Form Field where you enter the first name...

          Please verify the names of your Fields in Form!

          :)

          Comment

          Working...