Problem with not in the list item

dealwi8me

Registered User.
Local time
Tomorrow, 01:26
Joined
Jan 5, 2005
Messages
187
Hello,

I have a combobox that is bound to field CustomerName. The combobox has 8columns and each one is being assigned to a field in the form after the combobox is updated.
If i write a CustomerName that is not on the list ( i set the Limit Property=No) after updating the record i get #deleted# to every field on that record in the form.

I think that i get #deleted# because after updating the combobox there is no value to assign in the combo1.Column([ColumnNum]).

Is there a way to stop the after update event procedure if the CustomerName is not on the list?

Thank you in advance.
 
but i want the user to be able to insert a new record if he can't find it on the list.
 
You're welcome. Post back if you are still having problems. I find ComboBoxes neat and easy to work with.
 
You could use DCount() to see if the CustomerName is present in your onderlying query/table and only assign the values if the function returns something other than zero.
 
You could use DCount() to see if the CustomerName is present in your onderlying query/table and only assign the values if the function returns something other than zero.


I used DCount as following and i always get result=0 :confused:

DCount("*", "Customers", "[CustName] ='& Me.search_combo.Value &'")
'Me.search_combo.Value is the value of CustomerName in the form

any suggestion what am i doing wrong?
 
How about not using the asterisk but an actual Field Name from the Customers table.
 
i changed it to DCount("CustName", "Customers", "[CustName] ='& Me.search_combo.Value &'") and i still get zero.
 
Ah, just spotted it:

DCount("CustName", "Customers", "[CustName] ='" & Me.search_combo & "'")
 

Users who are viewing this thread

Back
Top Bottom