Form (Combo Box)

lhooker

Registered User.
Local time
Today, 12:46
Joined
Dec 30, 2005
Messages
431
I have a 'Yes/No' field in a table with no value for the 'Default Value' of the table definition. This field is bounded to a combo box of a form. When tabbing through the form the combo box insert 'No' automatically. If I blank out the value 'No', it comes back. I can override it with 'Yes', but I would like the user to select one or the other (with no value initially). If no selection, then I will generate a pop-up error message to alert the user of no value selected.
 
You have set the combo box to have a default value = No
In design view, go to the combo box property sheet and clear the default value
 
ridders,

The combo box and table both have no value.
 
It has to be set somewhere for this behaviour to occur.
Suggest you strip down and upload your db.
 
OK, I copied and stripped down my database. I'm getting the same results as soon as I enter data and tab down. The code for 'After Update' should not cause the problem. Uncle Gizmo, 'Option Group' ?


'Test' database uploaded.
 

Attachments

Uncle Gizmo, Pat Hartman,

I changed the 'Data Type' from 'Yes/No' to 'Short Text'. The default value of 'No' is no longer appearing when tabbing through the form. I'll work on moving the validation code to the 'Before Update' 'Event Procedure'. Thank you for the solutions to this error ! ! !
 
Pat Hartman,

If you're talking about 'DLookup'. I'm not using it. What are you talking about ? I'm just referring to fields in the 'Test' table.
 
Uncle Gizmo,

Thank you for the thorough explanation ! ! ! I though Pat Hartman was referring 'DLookup'. During my investigation, I did create code to test for '0' or '-1'. I have to check to see if I still have the code in place. Also, as suggested, I did try to do my testing for blank text boxes in 'Before Update' 'Event Procedure' , but it did not work. As I tabbed through without entering data, it did not produce the pop-up error message. This same code worked in the 'Test' database 'Finish' button. Can you explain why the below code works for the 'Event Procedure' for the 'Finish' button of my form ('Test' database - allready sent) and not in the 'Before Update' 'Event Procedure' ?

If IsNull([First_Name]) Then
MsgBox "Please enter your first name.", , " Missing First Name"
SurveyError = "On"
[First_Name].SetFocus
GoTo Bottom
End If

Lastly, Pat Hartman thank you for your suggestion ! ! !
 

Users who are viewing this thread

Back
Top Bottom