Topics Search

ComboBox field is null (how to check?)

ComboBox field is null (how to check?)
Views: 57
I've a comboBox call Me.cobProbNo, At the cobProbNo On_Change() event I want to exit sub when the combo box is empty.

so I've got this:

If Me.cobProbNo = "" Then
MsgBox "no problem exist"
Exit Sub
End If

Somehow, it does NOT get into the MsgBox statement. How do I 'capture' the fact that combobox may be null?
Sponsored Links:

More topics


ComboBox checking to see if value exists

So I have created this combobox that requires the user to enter a password when selecting a value in my unbound combobox. If the password is incorrect then the combobox is cleared and is reset to the value it was before the update was attemped.

Now I found code on getting this to work and it works great except for one minor flaw that I am trying to add to it. If the user goes to clear the combobox thus making the value null the Msgbox appears asking for the users password but fails each time because the null username does not exist.

I'm trying to make theproper if statement to check and see if the username selected from the combobox does not exist in the usertable then it just cancels the update statement.

(between I did not make this code I borrowed it from another forum)

How to filter form when value selected from combobox is null?

I have a combobox which has null as a valid value.I want the form to get filtered when user selects null as a value also.However no filtering happens when the value is null.I would liketo know is whether it is possible to filter if the record selected is null as the filter criteria will be empty string then?I am not posting any code as my question is just that can criteriabe null and still filter?

Select a Null value in Unbound Combobox

Using Access 2010.
I've got an unbound combobox with a default value, but I still would like users to enter a Null value. I've got the Null value in the list of drop down items, but when it is selected, the combox value does not go to null, but instead goes to the default value.
Any easy way to allow null values to be selected? I know it was possible with older versions of Access, but not any more.

Cannot get values for a Combobox..

I am trying to retrieve the unique names from a table into the combobox on a form. I have the attached code for the command button on the form.

'Invalid use of Null'.

if I use another table for a string value for the same recordset, the code works and the combobox gets populated with the unique names of the field selected.

I tried to retrieve the values for different fields from the table tblPlants, but I get the same error.
It appears that I cannot populate the combobox with any of the field values from the tblPlants. But the values are not Null - by using the code line for the MsgBox (msg), I am able to see the values in the MsgBox.
Or is it some other criteria I am missing?

updating field whose value is the word NULL and Not a typical 'null' value

I was given a table where in a text field, the value is NULL. (Actually spelled out like that.)
I need to convert that field to a date/time one. Which is being hindered by these values of NULL.

The problem is that when I put the word NULL in the field criteria spot, Access believes that I am referring to a value of 'null' and will not do the update.
I have done "NULL", NULL, =NULL, ="NULL", is NULL. and no success.
Please remember that the actual value is not 'null'. It is a text field that has the word NULL in the field.

Use an iif statement to deal with null values in criteria boxes

I did some research on this but never found a satisfactory answer.

Why is it that in the query builder when I enter the following into the criteria box it doesn't deal with the null in the combo

iif( isnull(forms!formname!combobox), is not null ,forms!formname!combobox)

shouldnt this return any feilds that are not null

Check if field is Null

I have a form called AddNewCustomer which has a field called Customer_Name, now I have a button that opens another button called Command1. The thing is, when I click on that button, I need it to check if Customer_Name is empty and if it is to give an Error, and if it is not null then check if the name exists in the main table tblCustomerInformation and if it does then giveserror and once a person clicks OK on the error it empties the field and if doesn't exist then open another form.

cascade combobox problem.

I have two comboboxes on a subform. The first combobox is used to populate the second combobox. These are placed in the detail section of the form.I want them to work this way:when I select any value from the first combobox,I want the second combobox of the same row to get populated by relevant value.

As of now, I have tried to implement this and as I select any value from the first combobox of row 1 I see the second combobox of the same row gets populated but as I go on selecting values from the first set of comboboxes I see that the values in the second set of the comboboxes above changing or becoming null.

The 1st combobox is cboRCMTask:

Use an iif statement to deal with null values in criteria boxes

Why is it that in the query builder when I enter the following into the criteria box it doesn't deal with the null in the combo

iif( isnull(forms!formname!combobox), is not null ,forms!formname!combobox)

shouldn't this return any fields that are not null?

Check multiple fields for null

I have a form with three text boxes. I would like to check for null in all the fields, and if there is a null textbox display a message box