Combo Box - Blank Row

Sprawl

Database Co-Ordinator
Local time
Yesterday, 22:17
Joined
Feb 8, 2007
Messages
32
I have a combo box that is part of a form that executes a specific query.

The data is taken from within a datasource I cannot edit. However I need it to insert a NULL value option into the combo box

The form works that the user selects a Branch location from the combo box. However, I want it so that they can also select NULL and get all branches.
 
It would probably be better to put a button on the form for this option. Having users remember that NULL = ALL RECORDS would be inconvenient for them anyway, don't you think?
 
I have a combo box that is part of a form that executes a specific query.

The data is taken from within a datasource I cannot edit. However I need it to insert a NULL value option into the combo box

The form works that the user selects a Branch location from the combo box. However, I want it so that they can also select NULL and get all branches.

Why don't you add a record "All Branches" in the source table of the combo box so that when this option is selected, it shows all branch locations.

Mike
 
Replace your combobox RowSource with something like this

Code:
SELECT YourField FROM YourTable
UNION SELECT "<All>" FROM YourTable;
filling in your actual field and table names.

Then use this code in the AfterUpdate of your combobox, once again filling in the actual name of your combobox:
Code:
Private Sub YourCombobox_AfterUpdate()
If Me.YourCombobox = "<All>" Then
[B]'Place code here to address selction of <All>
[/B]End If
End Sub
 
Replace your combobox RowSource with something like this

Code:
SELECT YourField FROM YourTable
UNION SELECT "<All>" FROM YourTable;
filling in your actual field and table names.

Then use this code in the AfterUpdate of your combobox, once again filling in the actual name of your combobox:
Code:
Private Sub YourCombobox_AfterUpdate()
If Me.YourCombobox = "<All>" Then
[B]'Place code here to address selction of <All>
[/B]End If
End Sub

Thank you missingling, this provided the necessary result.

Sorry for the delay as other "important" work always comes up
 
Don't you hate it when that happens?

Glad we could help!
 

Users who are viewing this thread

Back
Top Bottom