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

DBRadioGroup Error when query closes 1

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I have a DBRadioGroup (Public Employee o Yes o No) on my form. By definition, this is tied to the dataset query. I have an OnChangeEvent for the DBRadioGroup (if it's yes then make a TabSheet visible, otherwise leave it hidden). However when I press the OK button to exit the form and try to close the query, it runs the OnChangeEvent and the program crashes because there's nothing in the DBRadioGroup any more (the error is array index out of bounds). Anyone have an idea on what I need to do to close my query without triggering the OnChangeEvent?

Thanks!

Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
Can you check inside the event to see if the query is open, and if not, exit?

If this isn't possible, can you set a flag before you close the query, and run the onchanged event only if the flag is false? Brian
"There are 2 kinds of people in the world, those that divide people into two groups and those that don't. I belong to the second group." - tag line I stole
 
Sometimes it's the easiest solutions that your brain just can't quite see!!!

Checking if the query is active works like a charm!! Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top