Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    OpenForm command (2002)

    I am trying to use an Open Form command to open a form but I'm not sure how to do it if I want it to have the query select grades 1 to 5.

    I can do it for one grade. See below. Can I use this approach for more than one grade. If not how would you suggest I proceed.

    DoCmd.OpenForm "frmViewDataSelectedWeek", , , "Grade = '1'"

    Thanks.

    Paul

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OpenForm command (2002)

    Is Grade a text field, and if so, why? Shouldn't it be a number field?

  3. #3
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OpenForm command (2002)

    Yes, it is a text field because I have PreK and K as options

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OpenForm command (2002)

    OK. Try
    <code>
    DoCmd.OpenForm "frmViewDataSelectedWeek", , , "Grade In ('1','2','3','4','5')"</code>

  5. #5
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: OpenForm command (2002)

    That worked.

    Thanks Hans

    Paul

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OpenForm command (2002)

    Another option would be
    <code>
    DoCmd.OpenForm "frmViewDataSelectedWeek", , , "Grade Like '[1-5]'"</code>

Posting Permissions

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