combo box help

jeremypaule

Registered User.
Local time
Today, 01:11
Joined
Aug 21, 2006
Messages
135
I have a drop down list and I want a selection where it'll output nothing if selected, I tried to add a blank space to the table but it tells me I need to complete all fields when I select that in the form. How can I add a blank space to the combo box to output nothing?
 
Enter nothing in the combo on the form. Don't click the arrow.

An alternate method would be to go back to the table structure you are calling the combo box from.
Check all fields. Are there fields in that table that require input (Required -> yes)? If so, can you change them to Required->no without doing any damage to other parts of your database?
If you can, you should be able to enter a record in the table along the lines of the "Nothing" you mentioned above.
 
Last edited:
statsman said:
Enter nothing in the combo on the form. Don't click the arrow.

An alternate method would be to go back to the table structure you are calling the combo box from.
Check all fields. Are there fields in that table that require input (Required -> yes)? If so, can you change them to Required->no without doing any damage to other parts of your database?
If you can, you should be able to enter a record in the table along the lines of the "Nothing" you mentioned above.

The first suggestion of not clicking the arrow won't work because it tells me to complete all fields.

for the second suggestion, would I change tables from Objects or change it in the form design? Thanks for the help!
 
I have an Idea, but I need help on the code. I'm thinking I could make some parameters to exclude this certain combo box in the code when you press "submit" (which prompts 'Must fill in all fields' when one is empty). If you guys could help me out on the code that'd be great!!
 
can anyone else chime in?

is there some type of blank character I can input into the table?
 
For you to have a message box telling you that all fields must bee completed, there must be an IF statement in your code which checks each field for data. As long as Required=No on your combobox properties then you should be able to omit the field from the check in order for the code to move past it without any detrimental effects
 
Yes there is an IF statement. I have already set the table Design View to Required - NO, but I can't seem to find it on the form properies of the combo box. Would it be in those properties, if so what is it named?
 
Sorry, my bad. The Required = No field is in the Table design, not the form. Anyway, in your IF statement there should be either a variable for the combo box value or a direct link such as Forms!myform.cbobox. This line is the one that needs to be omitted. (use a ' to switch it off and then test before deleting fully) Once it is taken out, even if the combo is blank then the message box should not pop up anymore
 
Here is the code for the IF statement...

" For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acComboBox
If ctl.Value & "" = "" Then
MsgBox "You must fill in all data fields."
Exit Sub
End If
Case acTextBox
If Not ctl.Locked Then
ctl.SetFocus
If ctl.Text & "" = "" Then
MsgBox "You must fill in all data fields."
Exit Sub
End If
End If
End Select
Next"

Id rather not comment out the ability for the form to say all fields must be filled, I want it to allow ONE certain combo box to be able to be empty. the box name is Combo26, could you tell me what the code would be to exclude that?
 

Users who are viewing this thread

Back
Top Bottom