Results 1 to 3 of 3
  1. #1
    Kotoca is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    3

    filtering of combo box / vba code

    Hi

    I'm pretty new to access programming, and after hours of search I still haven't come up with a proper solution. I'd greatly appreciate some help!

    Goal of my Database: Recording bank transaction (money transfers from one account to another)
    Details: On the form on which I record these transaction I have two combo-boxes: 1)Account Debited and 2)Account Credited.
    Both combo-boxes have the same source, which is the Active-Account-Table.

    Unsolved Problem: After selecting an account number for the "Account Debited" I don't want this account number to reappear in the combo box of "Account Credited", as this account number has to be different than the one chosen in "Account Debited".




    Could anyone help me with that? It will be greatly appreciated!

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    In the afterupdate event for the second combo box insert this code:
    Code:
    Private Sub YourField_AfterUpdate()
    If Me.2ndComboBoxName = Me.1stComboBoxName Then
    MsgBox ("Change your Credit Account.")
    Me.2ndComboBoxName = Null
    Me.1stComboBosName.SetFocus
    End If
    
    End Sub
    Change the field names to match what you have in your form.

  3. #3
    Kotoca is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    3
    Thank you very much for your help.

    That was just what I needed. It works perfectly.

    Thanks again.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combo Box Not filtering
    By ss2020 in forum Forms
    Replies: 4
    Last Post: 01-17-2012, 01:16 PM
  2. Need help with filtering form code
    By bgeorge12 in forum Programming
    Replies: 3
    Last Post: 07-16-2011, 06:03 PM
  3. help with filtering code
    By ninachopper in forum Access
    Replies: 14
    Last Post: 09-09-2010, 06:16 PM
  4. filtering code
    By ninachopper in forum Access
    Replies: 2
    Last Post: 08-06-2010, 10:56 AM
  5. Replies: 0
    Last Post: 08-17-2008, 12:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums