Results 1 to 4 of 4

Thread: OpenForm Method

  1. #1
    Join Date
    Aug 2002
    Posts
    121

    Unhappy Unanswered: OpenForm Method

    In the "WHERE" argument of the OpenForm method, I'm trying to include criteria for 2 fields, as opposed to 1, and I'm unsure of the correct sytnax when using multiple fields and variables (prefixed by "v_" in the example
    below)... I also assume that variables can be passed in the WHERE argument?

    DoCmd.OpenForm "frm_chemo", , , "username = 'Smith'" AND "task_date = v_date"

    Can someone shed some light on this?

  2. #2
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    DoCmd.OpenForm "frm_chemo", , , "(username = 'Smith') AND (task_date = v_date)"
    ghozy.

  3. #3
    Join Date
    Aug 2002
    Posts
    121

    Wink

    Doooooh!!!


    Thanks ghozy, I should have picked up on that.

  4. #4
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    no problem. and this will use the name in txtname control as your filter.
    Code:
    DoCmd.OpenForm "frm_chemo", , , "(username = '" & txtname &"') AND (task_date = v_date)"
    ghozy.

Posting Permissions

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