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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NotInList event question

Status
Not open for further replies.

Theseekers

Technical User
Joined
Jul 22, 2004
Messages
118
Location
US
Dear Tekers,,

Is there away to by pass system error message(s) in a combo box with Notinlist event???

I have a combo box and when the notinlist event triggered it; I want the box get the focus again.

I have looked all threads about this problem in the forum but most had the add newdata feature in it. I did not want to add new data to the list but just want the box to get focus again.

I have tried to add the response = acdataerrcontinue in my notinlist event code. This works fine and eliminiates the system error such as "Data is not in list ...". However, I now get the RT error 94 - Invalid use of Null. ????

Can some1 show me how to regain contorl of a combo box with out the add feature and all the system messages.

TIA
 
Can you post the code behind NotInList Event?


________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
How are ya Theseekers . . . . .
Code:
[blue]   Response = acDataErrContinue
   MsgBox "Your Message Here!"[/blue]

Calvin.gif
See Ya! . . . . . .
 
Hi there ZmrAbdulla and Aceman,

Thanks for your input.

After further investigation, I found out that the error was not caused by the notinlist event but rather from the on change event of the control. My bad and sorry for the confusion.

If I may, can I as this question on the same post. On this drop down box, I the notinlist event to trap for none listed item. I also have an on change event because I will need to use the response from the drop down box to send to a function for caluation for another field. How can I prevent any system error when sone one trigger the notinlist event. Currently, if I enter something not in the list then the notinlist event kicks in and with response = acdataerrcontinue; i by pass the normal system error message but the on change event also kicks in and and give me the Invalid use of Null.

Below is my code for those 2 events:

Code:
Private Sub CboQ1_NotInList(NewData as string, Response as Intger)
    Response = accDataErrcontinue
    me.CboQ1.SetFocus     <====  This works fine

end Sub

Private CboQ1_Change()

  me.TxtQ2 = CDIScore(me.CboQ2.Column(0), 2) <== this give me the Invalid use of Null error.

end sub
What I would like to do is try to test for the value of the combo box in the event of the NotInlist is raised???. Does the combo box has a boolean or some sort of value that is raised when someone enter value that was not in the list????

If any of you have this info, please let me known. This is the only thing that prevent me from complete this module.

As always, thanks for the advice and info

I am still seeking......
 
What is "CDIScore"?

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
Why not using the AfterUpdate event procedure instead of the Change one ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi all,

Found the solution to my problem..

I have to test for the value of my combobox in the OnChange event and go on from there.

Code:
   if (mycombo.column(0) >= 1 and mycombo.column(0) <= 3) then
      do my calculation
   else
      mycombo.setfocus
   end if

Hope this will help someone else in this situation.

I can stop seeking... now.
 
Hi,

ZmrAbdulla - CDIScore is my customized function.

PHV - I will play with it in the After Update per your suggestions.

Thank you both for your input.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top