473,395 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Add Null Value to Combo Box

6
I am using Access 2003 and working on a query by form. I have a form with two unbound combo boxes. The form searches our contact list for people in a certain renewal cycle. It then gives the option of looking for a certain constituency within that group.

The first combo box, cboRenewalCycle, lets the user select from a list of Cycles (FEB, JUN, SEP). The second, cboConstituent, lets the user select from a list of Constituents (Business, Foundation, Partner). The constituent field resides on the tblJoinAddress, but each contact does not have the field filled in. The combo box, cboConstituent draws its values from tblREF_Constituent. Item 1 in that table is a blank field, and I thought that would take care of it.

I would like to add a null value to the combo box, so that the user can just pick a cycle if they want, and they don't have to do anything with the Constituent combo box. Essentially I would like to add a null value to the box.

Any suggestions?

Can I also add a select all option?
May 1 '07 #1
2 10573
MMcCarthy
14,534 Expert Mod 8TB
I am using Access 2003 and working on a query by form. I have a form with two unbound combo boxes. The form searches our contact list for people in a certain renewal cycle. It then gives the option of looking for a certain constituency within that group.

The first combo box, cboRenewalCycle, lets the user select from a list of Cycles (FEB, JUN, SEP). The second, cboConstituent, lets the user select from a list of Constituents (Business, Foundation, Partner). The constituent field resides on the tblJoinAddress, but each contact does not have the field filled in. The combo box, cboConstituent draws its values from tblREF_Constituent. Item 1 in that table is a blank field, and I thought that would take care of it.

I would like to add a null value to the combo box, so that the user can just pick a cycle if they want, and they don't have to do anything with the Constituent combo box. Essentially I would like to add a null value to the box.

Any suggestions?

Can I also add a select all option?
What is the current row source of cboConstituent?
May 4 '07 #2
JConsulting
603 Expert 512MB
>>The constituent field resides on the tblJoinAddress, but each contact does not have the field filled in.

Use this for the rowsource for your combo box. It will add an All option and a "blank" option, along with your list of constituents.

Select '<All>' as constituent from tblJoinAddress
union
Select Null as constituent from tblJoinAddress
union all
Select distinct Constituent from tblJoinAddress
order by constituent;

J
May 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

16
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not...
0
by: Sandra Setz | last post by:
Hi, I have a continuous form with a combobox that gets its values from a table with no null values. For some reason, whenever I add a new record in the form, Access tries to look up the current...
2
by: Bob Darlington | last post by:
When a user clears a value from a combo box (by pressing the delete key), the following message appears: "You tried to assign the null value to a variable that is not a variant data type". ...
2
by: givlerj | last post by:
I need some help. Here is a little background, I support a MS Access 2k DB (SQL Server 2k backend) that has courses and students. The problem form lets the user pick a course from a drop down and...
0
by: Grant | last post by:
Hello, What do I do with a combo box if I have a null value? I have two tables linked in an access database - Table1 contains a column called "state" (integer) which is linked to Table2 which...
3
by: Jim | last post by:
I am trying to use a combo box in order to write a query on the fly. I want to check for a null entry so i can replace it with "Like *" or similar. If Combo0.Value = Null Then MsgBox ("null") ...
12
by: Aidan | last post by:
I have a form to create a new record for a training course. The form is based on one table that has 4 keys set to primary key. The first combo box on the form allows selection of the course POP...
4
by: Greg (codepug | last post by:
Private Sub cboBody_KeyDown(KeyCode As Integer, SHIFT As Integer) 'Delete combobox entry if Del or Backspace key is hit. If (KeyCode = 46) Or (KeyCode = 8) Then Me.cboBody = "" End Sub I have...
5
by: bkberg05 | last post by:
Hi - I have a combo box field on a form. The field is required (can't be left blank). Occassionally a user will come to the field and the combo box will not contain the desired record. So I added...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.