By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,829 Members | 670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,829 IT Pros & Developers. It's quick & easy.

Updating a record with Value from a combo box

P: n/a
Hello All,
I am have created this form that allows the user to Add/Edit an
Employees info. In it I have several Combo Boxes that forces the user
to select one of the options containned in the combo box, the only
problem is when I click on the button to save the changes it doesn't
write the selected value to the record. Instead I get an error that
says "Object Required". Now I place a condition in my code so that if
the value in the combo box is blank to not update that record field.

Here is a sample of the code that I am using.

If Me.ComboLanguage Is Not Null Then
[LANGUAGE] = Me.ComboLanguage
End If

I'm pretty sure it's wrong but I am not clear as to how to do this
correct seing my knowledge of VB is very basic.
Thanks in advance for your help.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Bobbak" <bo****@ottawa.com> wrote in message
news:64**************************@posting.google.c om...
Hello All,
I am have created this form that allows the user to Add/Edit an
Employees info. In it I have several Combo Boxes that forces the user
to select one of the options containned in the combo box, the only
problem is when I click on the button to save the changes it doesn't
write the selected value to the record. Instead I get an error that
says "Object Required". Now I place a condition in my code so that if
the value in the combo box is blank to not update that record field.

Here is a sample of the code that I am using.

If Me.ComboLanguage Is Not Null Then
[LANGUAGE] = Me.ComboLanguage
End If

I'm pretty sure it's wrong but I am not clear as to how to do this
correct seing my knowledge of VB is very basic.
Thanks in advance for your help.


I believe the error is in how you are referring to the fields. You are
supposed to use "!" as a separator instead of ".". For instance, your code
should be:

If Me!ComboLanguage Is Not Null Then
[LANGUAGE] = Me!ComboLanguage
End If

Steve

Nov 12 '05 #2

P: n/a
"Bobbak" <bo****@ottawa.com> wrote in message
news:64**************************@posting.google.c om...
Hello All,
I am have created this form that allows the user to Add/Edit an
Employees info. In it I have several Combo Boxes that forces the user
to select one of the options containned in the combo box, the only
problem is when I click on the button to save the changes it doesn't
write the selected value to the record. Instead I get an error that
says "Object Required". Now I place a condition in my code so that if
the value in the combo box is blank to not update that record field.

Here is a sample of the code that I am using.

If Me.ComboLanguage Is Not Null Then
[LANGUAGE] = Me.ComboLanguage
End If

I'm pretty sure it's wrong but I am not clear as to how to do this
correct seing my knowledge of VB is very basic.


"Is Not Null" is a SQL statement, not one recognized in VBA.

Use the VBA IsNull() function instead.

If IsNull(Me.ComboLanguage) = False Then
[LANGUAGE] = Me.ComboLanguage
End If
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.