Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    Hamilton, NZ
    Posts
    25

    Post Unanswered: Combo box in a query

    Hi there

    I would like to put a combo box in a query. In my main table I have a field called Category (friends, business contacts etc) where it is a combo box where users are able to select a category.

    I am wanting to make a query where it also has this drop down box so users can also choose from this and then I can can turn the results into a report.

    SELECT Contacts.Title, Contacts.FirstName, Contacts.LastName, Contacts.Category, Contacts.Home_PhoneNumber, Contacts.Home_CellPhoneNumber, Contacts.Business_PhoneNumber, Contacts.[Business_Cell phone]
    FROM Contacts
    WHERE (((Contacts.Category)=[Please select the category]));

    I'm not sure how to put the combo box in here. Can anybody out there help me.

    Thanks

    Mike

  2. #2
    Join Date
    Sep 2003
    Location
    Hamilton, NZ
    Posts
    25
    Hi there again

    I may have not explained this good enough and have since reliesed part of the reason where I am going wrong. I need to get this from a form.

    I am triing to put a combo box from a form [contact] into my query so the user can choose options.

    SELECT Contacts.Title, Contacts.FirstName, Contacts.LastName, Contacts.Category, Contacts.Home_PhoneNumber, Contacts.Home_CellPhoneNumber, Contacts.Business_PhoneNumber, Contacts.[Business_Cell phone]
    FROM Contacts
    WHERE ((Contacts.Category) Like [forms]![Contact]![Category]);

    I know I am almost there from rearch in other areas but the combo is not happening.

    Can any body help me.

    Mikeg950

  3. #3
    Join Date
    Aug 2003
    Posts
    14
    Here's one way but not using SQL, create a form using the wizard based on your contacts table and the fields that you want your query to look up, convert the boxes into combo boxes so that they are containing relevant data, then point your query at the combo box and form for the information.


    WHERE ((Contacts.Category) Like [forms]![contactsearchform]![Comboboxname]);

  4. #4
    Join Date
    Sep 2003
    Location
    Hamilton, NZ
    Posts
    25
    Thank you Dgillies

    I have reliesed that you are unable to make a query in SQL with a built in combo box. So from your idea and others I have made a form with the combo box and the query compares the data in the Contacts.category with the data in the new form "Choose Category".

    WHERE (([Contacts].[Category]) Like [forms]![Choose Category]![Choose Category]);

    Now as you know when you want the query to run you click the "Preview phone no" button which opens the "Choose Category" form where you select from the combo box the category that you want the report to create. I have made a button on this "Choose Category" form where it then opens the Form "Phone numbers by category". This is now running great.

    I will now be able to use this concept with the Birthday Report.

    Choice thanks again.

    Mikeg950
    Mikeg950

Posting Permissions

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