Pop Message when entering info in the combo box

M

Mani

Hi! For some reason I am not able to enter information in the combo box
because a message pops up as follows:

This expression is typed incorrectly, or it is too complex to be evaluated.
For example, a numeric expression may contain too many complicated elements.
Try simplifying the expression by assigning parts of the expression to
variables.

In the past I was able to enter in this particular combo box field, but I
just recently created a module for a new form I created, I don't know whether
or not it has anything to do with each other. Please help me!! Thanks in
advance!
 
D

DStegon via AccessMonster.com

ENTERING data INTO a combo Box??? Is the combo box bound or unbound? Usually
you select data FROM a combo box not add data "to" a combo box. I have
situations where we allow a user to add to the list, but yo need to set that
as something you will allow. If you do not allow then you can use something
like this to make sure the user is entering proper info. The addNewData is a
function that tries to add the data and verifies it correct correctness.

Private Sub cmbClass_NotInList(NewData As String, Response As Integer)

If FL_frm_msgbox("This expense is not available. If you have permission,
would you like to add it now?", vbYesNo, "Add Expense") = vbYes Then 'custom
msgbox... you can use just MsgBox to do same thing
If addNewData(NewData) Then
Response = acDataErrAdded
Me.cmbClass = NewData
Else
Response = 0
Me.cmbClass = ""
End If
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top