Results 1 to 6 of 6

Thread: Query which accept date from the form and search into the table?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    VBAX Expert Imdabaum's Avatar
    Joined
    Jun 2006
    Posts
    652
    Location
    So imagine you have a sample form that follows the format below;

    ____________________________________________________________
    ----------------------------TITLE OF FORM--------------------------
    lblID txtID lblCompanyAddedOn dteIN

    lblCompany txtCompanyName lblCriteriaFilter txtDateFilter

    ____________________________________________________________

    Right click on the field that you have set to be the filter or criteria (in this example txtDateFilter).
    Click on the Event Tab and click the [...] button on the row that says, "After Update", select Code. You will be brought to the VBE. There enter the following code.

    (based on the example I drew up)
    [VBA]
    Private Sub txtDateFilter_AfterUpdate()
    Me.Filter = "dteIn < " & txtDateFilter
    Me.FilterOn = True
    End Sub
    [/VBA]
    That should do it.
    Last edited by Imdabaum; 07-15-2010 at 08:56 AM.
    Someday I'll understand everything...
    Even then...I'll still pretend I'm a beginner.

Posting Permissions

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