Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems typing into a combo box

Status
Not open for further replies.

barrylowe

Programmer
Nov 6, 2001
188
0
0
GB
I have a small form which is used to record recommendations against health issues for a patient.

The form had 2 combo boxes on it; Recommendation and Status.

Recommendation gets it values from a lookup table. The rowsource of the recommendation combo is set to the following:

SELECT codes_Recommendations.RecommendationTypeID, codes_Recommendations.Recommendation FROM codes_Recommendations ORDER BY codes_Recommendations.Recommendation;

The status combo uses a value list and defaults to a value of "Ongoing".

Next to the recommendation combo the is a little button which opens up another dialog form that allow the users to add to the list of recommendations in the combo.

The problem I am having is that the users are starting to type into the combo, then when they realise what they are typing isn't in the list they delete it using the backspace key then click the little button to try and add it into the list.

When they click the button they are getting the following error:

"You tried to assign the Null value to a variable that is not a Variant data type"

This only happens when they delete out what they have typed into the combo.

Any thoughts?
 
Which line of code raises the error ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya barrylowe . . .

Is there any reason why your not using the [blue]NotInList[/blue] event of the [blue]Recommendation[/blue] combo to add new Recommendations, instead of an entire form?

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Hi Barrylowe,

then click the little button to try and add it into the list
How about checking for null and if true then reset it to default "Ongoing".


Ian Mayor (UK)
Program Error
Your lack of planning is not my emergency!
 
Thanks for getting back to me guys.

PHV - The error is raised when I click on the button or move away from the recommendation combo, but there is no one line of code that falls over.

TheAceMan1 - To be honest I never really thought of doing it that way as it is not our standard user interaction and to replace all of the Add buttons would be too big a task at this stage fo the development.

ProgramError - I can't set a default for the Recommendation combo. It is the Status combo which has a default of Ongoing. what I really want to do it cancel the action of typing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top