Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Posts
    9

    Red face Unanswered: Change parameter through VBA

    hi all,
    I have created a form that allows user to select order# from a dropdown combo box.This form also contains a command button "show report", clicking on which open a report bound to a parameterized query. When click on, it prompts for the parameter.

    What I want is without prompting the user to enter parameter, I want to supply the paramerter as combo item selected by the user.
    is it possible??

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    If I'm reading you right, you would put the criteria in the query (for the report). In the query, under the parameter field column, on the criteria row for that column, put something like this: Like Forms!MyFormName!MyComboBoxName & *

    Then to open the report.....
    Make the form invisible (i.e. Forms!MyFormName.visible = true) Then open the report. When closing the report: Forms!MyFormName.visible = false. Making it invisible still makes it accessible for the report to read the values on form for the reports query and then you make it visible again when the report closes.
    Last edited by pkstormy; 05-20-07 at 23:31.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926

    Sample report

    Here's a sample report which you can look at and see if it helps. Modify it to fit your needs.
    Attached Files Attached Files
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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