Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi. I have created a form with a combo box and a command button for users to make a selection using the combo box and then use the OK command button to open a new form that is filtered via the selection from the combo box. The following code and any variations I have played with so far, either won't work at all, or will display a parameter box that has, as its heading, the selected entry from the combo box. What am I missing here please?

    DoCmd.OpenForm "frmExpiryDateList", acNormal, , "[AcctExec]= " & """ ' [cmbAcctExec] & '"""

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If AcctExec is a text field, try

    DoCmd.OpenForm "frmExpiryDateList", , , "[AcctExec]=" & Chr(34) & [cmbAcctExec] & Chr(34)

    If it is a number field, try

    DoCmd.OpenForm "frmExpiryDateList", , , "[AcctExec]=" & [cmbAcctExec]

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Sydney, New South Wales, Australia
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='785346' date='20-Jul-2009 15:33']If AcctExec is a text field, try

    DoCmd.OpenForm "frmExpiryDateList", , , "[AcctExec]=" & Chr(34) & [cmbAcctExec] & Chr(34)

    If it is a number field, try

    DoCmd.OpenForm "frmExpiryDateList", , , "[AcctExec]=" & [cmbAcctExec][/quote]


    The text option worked perfectly. Thanks, Hans.

Posting Permissions

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