Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    2

    Red face Unanswered: Help With DoCmd.Openforms

    I want the following code entered into my event

    DoCmd.OpenForm "ListCarriers", , , "Carriername = '" & Carrier & "'", acFormReadOnly, acDialog,
    With Forms![ListCarriers]
    !PassedData = "Yup"
    End With

    I get the famous "Compile Error " : Expression expected...

    What is wrong..

    Rob_Evelyn@insightbb.com

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    It looks like you've got a trailing comma after the ...acDialog

    That would cause the error you're seeing
    Inspiration Through Fermentation

  3. #3
    Join Date
    Aug 2003
    Posts
    2
    Originally posted by RedNeckGeek
    It looks like you've got a trailing comma after the ...acDialog

    That would cause the error you're seeing
    How Do I get the With Forms! to passed to the listcarries form. If I remove the comma is it still considered part of the command ?

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Sorry, I misread the "With" statement, and everything after, as seperate code.

    Try it this way:

    DoCmd.OpenForm "ListCarriers", , , "Carriername = '" & Carrier & "'", acFormReadOnly, acDialog, "[PassedData] = 'Yup'"
    Inspiration Through Fermentation

Posting Permissions

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