Results 1 to 3 of 3
  1. #1
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    310

    unbounded Combo box

    Hi,
    When I click the command button, the following VBA code is executed:

    DoCmd.OpenForm "frmPersons", acViewNormal, , WhereCondition:="[DateDeparted] IS NULL"

    The form has an unbound combo box cboPersonLookUp with a Row Source: qryPerosnsLookUp.


    The Combo box is used to search for a certain person. The list shows ALL persons: Who departed and who did not depart.

    I need a second command button to open the same form (frmPersons) with the ability that the combo box showing only those persons who departed. i.e. [DateDeparted] IS Not Null?

    I can do this by having two queries and two forms. Is there a way to having having these two forms and two queries?

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You could have one form and two buttons - one button to show not departed and another to show departed.

    Consider:

    Click a command button, the following VBA code is executed:
    Code:
    DoCmd.OpenForm "frmPersons"
    Forms "frmPersons" opens displaying all records.
    Click button "Not Departed", sets a filter:
    Code:
    Me.Filter = "[DateDeparted] IS NULL"
    Me.FilterOn = TRUE
    Or click on button "Departed", sets a filter:
    Code:
    Me.Filter = "[DateDeparted] IS NOT NULL"
    Me.FilterOn = TRUE
    Third button ("Remove Filter") to remove filter
    Code:
    Me.Filter = ""
    Me.FilterOn = FALSE

  3. #3
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2003
    Join Date
    Jun 2016
    Posts
    310
    Thanks for the reply

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

Similar Threads

  1. Replies: 1
    Last Post: 12-09-2015, 10:23 AM
  2. Replies: 3
    Last Post: 03-11-2015, 12:36 PM
  3. Replies: 8
    Last Post: 04-01-2014, 02:12 PM
  4. Replies: 5
    Last Post: 10-11-2012, 06:46 PM
  5. Unbounded combo box
    By wasim_sono in forum Programming
    Replies: 3
    Last Post: 01-26-2006, 10:14 AM

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