Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2004
    Posts
    660

    Unanswered: combo box with report

    I have a combo box calle comboIDType in my main form. The IDTYPE is string value. ("aa", "bb" , "ccc"). I would like when i select one type in the combo box, and click the get report button, it will retrieve all the record based on the IDType the user seleceted. I have a query call qryIDReport and report calle IDreport based on this query.

    I have a question, how can i get the IDTYPE value that the user select?

    use comboIDTYP.text?

    In the get report event, i have the follwing code:

    DoCmd.OpenReport stDocName, acViewPreview, , "ID=" & ComboID1.Text

    but it didn't work. How can i get the string value from the combobox when the user select.

    Many thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    Don't muck around with the Text property. It serves no real purpose about 99% of the time. .Value is the default property, so there is no need to specify. Your data is text rather than numeric so:

    Code:
    DoCmd.OpenReport stDocName, acViewPreview, , "ID='" & ComboID1 & "'"
    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2005
    Posts
    31

    help!!

    I have a similar problem, i am trying to use a combo box in a form to select various properties. upon selecting the property i want the report of that property to open. however, i have one report to deal with every property and so before thinking of this i used the report based on a query and used the "crieria" part so a message box would come up and i would need to write in the name of the property and the report would open. so now i need the correct property to appear using the input of the combo box.

  4. #4
    Join Date
    Mar 2004
    Posts
    660
    I tried

    DoCmd.OpenReport stDocName, acViewPreview, , "ID='" & ComboID1 & "'"

    it showed nothing in the report.

  5. #5
    Join Date
    Feb 2005
    Posts
    31
    what is COMBOID1 ?

  6. #6
    Join Date
    Mar 2004
    Posts
    660
    comboID1 is the name of combo box for the IDType. I tried, it didn't work, It didn't show all the records. There is no record on the report.

  7. #7
    Join Date
    Mar 2004
    Posts
    660
    I got it work. You are correct. Thanks and have a nice weekend.

Posting Permissions

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