Results 1 to 3 of 3

Thread: Access Question

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    Lisle, IL USA
    Posts
    20
    This is more of an Access question then VB, but I need it for a program that might get used with VB. Anyway, I need to know how to put a value onto a report that the user will enter from a popup input box. When a query is run and in the Criteria box you put in a question, exp. [Enter Start Date]. How do I capture that value and put it onto a report.

    Thanks for any help and if I was not clear enough let me know.

    Kevin

  2. #2
    Guest
    Instead of using [Enter start date], create a custom dialog box. Let say creating a form named "frmDate", you will then insert [Forms]![frmDate]![txtStartDate] in the criteria. In the design view of the report, create a bound textbox that refers to the frmDate!txtStartDate control. Hope this helps.

  3. #3
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    Kertsman

    This should be a little easier

    I assmue on the form with the text box there is a button that executes the report. All you should have to do is as follows:
    [code]

    Dim sSQL as String

    sSQL = "[DateField in Report]=" & [Forms]![frmDate]![txtStartDate]

    DoCmd.OpenReport "Your Report", acViewNormal, ,sSQL

    [\code]

    The sSQL at the end of the openreport method creates a where statement when you open it.

    Gazza

Posting Permissions

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



Click Here to Expand Forum to Full Width