ComboBox field is null (how to check?)
so I've got this:
If Me.cobProbNo = "" Then
MsgBox "no problem exist"
Somehow, it does NOT get into the MsgBox statement. How do I 'capture' the fact that combobox may be null?
Thank you for taking the time to report an issue.
What's wrong... Please write below.
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)
'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?
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:
Details: On the form on which I record these transaction I have two combo-boxes: 1)Account Debited and 2)Account Credited.
Both combo-boxes have the same source, which is an Active-Account-Query.
I have the following code to avoid Account Credited and Account Debited to be the same:
This code works fine, but the problem I have is, that when the focus returns to the combobox ctlCreditAccountNumber, the account number I've entered just before (and which is wrong) is still there.
I would like the combobox to be clear of any text, after the message box disappears.
I have tried putting the rowsource to "", I have tried = Null, and Undo but nothing works. From what I gather, the reason for that is that the combobox is a bound field. That is something I can't change though.
My issue is that if a person uses the date picker and chooses an existing date (instead of the combobox), I get an error for the combobox code once they try to save.
I was thinking that a simple VBA code in the Lost Focus event of the date picker could fix this. It would say something to the effect of:
If Date Chosen = Existing Date Then
MsgBox("Use combobox for existing dates")
Essentially, the user would be unable to choose an existing date from the date picker, and would have to use the combobox instead.
I don't know how to write out the first part "Date Chosen = Existing Date". All I could think of was "DTPicker0.Value =" or "Me.DTPicker0.Value = ", but wasn't sure how to check it against existing dates.
GDS Variant field. 4. No pack size, this is bit tricky, to find out the items which don’t have pack size we need to check the material description I.e. Description field in our sample file.
For e.g. if any item does not not have any number in the description You can pick out that particular item. I have tried with your query but I did't get any result. thequery is SELECT GDSBarnd, GDSSubBrand, GDSVariant, Description FROM Sheet1
WHERE Sheet1.GDSBarnd Is Null
OR Sheet1.GDSSubBrand Is Null
OR Sheet1.GDSVariant Is Null
OR Sheet1.Description Is Null | when I run this query all null values will be present.
My Form is: frmReview
My ComboBox is: cmbGLimpact
The RowSource is: SELECT DISTINCT [GLimpact] FROM Initiatives UNION SELECT Null As AllChoice FROM Initiatives ORDER BY [GLimpact] DESC;
The Query Criteria is: [Forms]![frmReview]![GLimpact]
The field values are: Yes, No & TBD
The filter works fine for Yes, No & TBD, but the blank choice doesn't return all records.
I need to be able to setup several filter ComboBoxes to enable filtering on several different fields. So, depending on which ComboBox filter (field) the user wants to filter on, the otherswill allow all records to be returned.
am I missing something obvious