Results 1 to 6 of 6
  1. #1
    dougb is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    4

    Help creating a search form that produces a report

    Hello,


    Using access 2003:

    I am working for a small company that needs to keep track of all of our computer resources. I have created a report called "workstation Profile" that takes all of the information needed from a table called "asset schedule." Now I want to create a form that allows me to search by the record "workstation" then click the search button and it brings up the report for that particular workstation, that I can then print out.

    Any help is greatly appreciated.

    Thanks

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    With what part are you having trouble?

  3. #3
    dougb is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    4
    Sorry I guess I wasn't very specific.

    I have created a from with a combo box that is loaded with a list of all of the "workstations" (the record that I am using to search by) I also made a button to find and retrieve the report for that workstation. I can get the button to bring up a report but not the report in the combo box. How do I bind the button to the combo box so that when you click the search button it brings up the report for the item selected in the combo box?

    Also, in my original table, (where all of the data is coming from) some of the records listed are null in the field that I am searching for, (workstations, some devices are not workstations but servers or other devices.) How do I exclude those null listings in my combo box?

    Thanks a lot

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Quote Originally Posted by dougb View Post
    I have created a from with a combo box that is loaded with a list of all of the "workstations" (the record that I am using to search by) I also made a button to find and retrieve the report for that workstation. I can get the button to bring up a report but not the report in the combo box. How do I bind the button to the combo box so that when you click the search button it brings up the report for the item selected in the combo box?
    Do you have different reports for different workstations? What is the code behind your button?
    Quote Originally Posted by dougb View Post
    Also, in my original table, (where all of the data is coming from) some of the records listed are null in the field that I am searching for, (workstations, some devices are not workstations but servers or other devices.) How do I exclude those null listings in my combo box?
    What is the SQL for the RowSource of your ComboBox?

  5. #5
    dougb is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2009
    Posts
    4
    "Do you have different reports for different workstations? What is the code behind your button?"

    I have one report that displays all the information I need from the original table. It displays each workstation's details as a single page, which I will then print out.

    The button code is as follows:

    Private Sub Preview_Report_Click()
    On Error GoTo Err_Preview_Report_Click

    Dim stDocName As String

    stDocName = "Workstation Profile"
    DoCmd.OpenReport stDocName, acPreview

    Exit_Preview_Report_Click:
    Exit Sub

    Err_Preview_Report_Click:
    MsgBox Err.Description
    Resume Exit_Preview_Report_Click

    End Sub

    It's just the default code from the creation of the button. I just don't know how to match it to the combo box.

    "What is the SQL for the RowSource of your ComboBox?"

    ok, I figured out how to set the criteria to "is not null" on the combo box. Thanks, it took your question for me to figure it out.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The OpenReport command has a WhereCondition argument that applies a filter to the report. This should work nicely for your setup. Just reference your ComboBox in that argument.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Problem Creating Report
    By Access_CFO in forum Reports
    Replies: 3
    Last Post: 04-01-2009, 01:08 PM
  2. Search Form Results Displayed In Report
    By warrenjburns in forum Forms
    Replies: 1
    Last Post: 03-18-2009, 02:08 AM
  3. creating a report in this manner
    By jiwatramani in forum Reports
    Replies: 1
    Last Post: 11-07-2008, 11:39 PM
  4. exporting text produces a number
    By greend in forum Import/Export Data
    Replies: 0
    Last Post: 07-12-2006, 03:55 PM
  5. How about creating a drop down menu in a report?
    By beastmaster in forum Access
    Replies: 2
    Last Post: 12-29-2005, 01:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums