Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2004
    Posts
    3

    Unanswered: Display Message based on Combo box selection

    I would like to display a message to the user based on the value they select from a combo box. If they select an account number from the combo box and in the account number table the record has an "X" in the Profit_Center_REQD field, then message "Account <account_number_selected> requires a Profit Center, please select one from the box below." is displayed.

    Thanks

  2. #2
    Join Date
    Jun 2004
    Posts
    92
    Assuming your combo box is named accountnumber then this is the code: Put it in the on change event for the combo box.

    If Accountnumber.Column(1) = x Then
    MsgBox "Account " & Accountnumber.Column(0) & " requires a Profit Center, please select one from the box below."
    End If

  3. #3
    Join Date
    Aug 2004
    Posts
    3
    I copied it into the change event file and nothing happened (I changed combo box name and column number), what am I doing wrong? here is the event:

    Private Sub Account_Change()
    If ACCOUNT.Column(2) = x Then
    MsgBox "Account " & ACCOUNT.Column(0) & " requires a Profit Center, please select one from the box below."
    End If
    End Sub


    Database is attached

    Form=Journal_Entries
    Combo box=Account
    Combo box row source=Q_GL_ACCOUNT_LIST_FILTERED (which is filtered based on JE_Type combo box)
    Attached Files Attached Files

  4. #4
    Join Date
    Jun 2004
    Posts
    92
    Worked for me.. Chose PRE as JE type, reversal as no, then picked account 10600001 and the msgbox came up.

  5. #5
    Join Date
    Aug 2004
    Posts
    3
    account 10600001 does not have an x in the third column. When I placed quotes around the "X" it displayed the message only when an account with x was selected.

    Your help was a BIG help, THANKS!!

Posting Permissions

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