Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    New Jersey, USA
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DoCmd conditions (97 sr2)

    Can anyone tell me what I am doing wrong here? I am concerned that I am not coding the conditional part of this statement correctly. Everything compiles. When I run the code it is asking for a parameter value for [Qry: Rep/Insurance Appointments - ALL]![State] . I am sure it is the AND statement but I don't know what else to do. I have to meet both conditions.

    DoCmd.OpenReport "REP/INSURANCE", acPreview, "", "[Qry: Rep/Insurance Appointments]![DepartmentName]=[Forms]![Form: Report Menu New]![DEPT] And [Qry: Rep/Insurance Appointments - ALL]![State] = [forms]![form: other license report]![cbostate]"

    Thanks

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

    Re: DoCmd conditions (97 sr2)

    The first part of your Where-condition refers to Qry: Rep/Insurance Appointments and the second part to Qry: Rep/Insurance Appointments - ALL. Is this difference intentional?

    P.S. I recommend that you avoid using this method of naming objects in the future. Spaces, colons and slashes may lead to problems in some circumstances, and make referring to the objects more difficult than necessary. Although there is no single standard, many Access developers use a naming system along the following lines:
    <UL><LI>Names contain no spaces and special characters.
    <LI>Names use a 3 character lower case prefix: tbl for table, qry for query, frm for form, rpt for report, mcr for macro, bas for VBA module and dap for data access page.
    <LI>Words within the name are capitalized: tblEmployeeData, rptOrderSummary etc.[/list]

  3. #3
    2 Star Lounger
    Join Date
    Aug 2002
    Location
    New Jersey, USA
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DoCmd conditions (97 sr2)

    Thanks, I never saw that. It was a mistake. It works fine now. Also thanks for the tips.

Posting Permissions

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