Results 1 to 5 of 5
  1. #1
    Join Date
    May 2002
    Posts
    20

    Unanswered: combobox and report, PLEASEEE HELPPP :(

    I need to put in a form a combo box with the list of departments of a company, and after a departament is selected the user should clik in a boton to open a report that is index and only shows the iformacion of that department..What is the best way to do this?

    Thanks in advance

  2. #2
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228
    You could create a report showing all departments and open it with a criteria
    Code:
    Sub OnMyButtonClick()
        DoCmd.OpenReport "MyReport", acViewPreview, , "Department=" & Me.MyComboBox
    End Sub
    acViewPreview shows the print preview, acViewNormal would immediately print out the report.

  3. #3
    Join Date
    May 2002
    Posts
    20

    almost...

    thanks it is better now.. but only one problem.. now when i clik in the button it appears a message to write the value of the field..but what says in the box that appears is the value that I want (the name of the department) the only problem is that it prompts me to erite it and it should discover that the value was that...

    If what I'am trying to explain is to confused and you dont understand thank any very much anyway, my inglish isn't very good so I cant explain very well..#)

  4. #4
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228
    ah sorry, my bad, if it's a string value you'll need to place it in ticks ('):

    DoCmd.OpenReport "MyReport", acViewPreview, , "Department='" & Me.MyComboBox & "'"

  5. #5
    Join Date
    May 2002
    Posts
    20

    many thanks

    THANKS A LOT!!! ))))))
    You really safed me if you ever pass by portugal say that I buy you a drink eheh

    many thanks

Posting Permissions

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