Combo Boxes Error Trapping

A

AFKAFB

Hi
I've a number of combo boxes bound to a form.

Each combo box has an AfterUpdate event which sets the focus to another
combo box and disables the current box.

Thats all fine when the user clicks YES/NO as per the options but when
they type in something else the focus seems to go elsewhere.

I can see on a command box how the 'Err' command works but how would
this work on a combo box.

code example below:

Combo40_Afterupdate()

if combo40.value <> "" then

combo50.enabled = true
combo50.setfocus

combo40.enabled = false

end if

end sub

where would i insert the err command.

regards

chris
 
R

RuralGuy

To answer your question you put in the error handling the same
everywhere. At the beginning of each SubRoutine you put:
On Error GoTo YourErrorHandlerForThisSubRoutine

A more curious question is: are you using ComboBoxes for YES/NO
questions? Is the RowSourceType a ValueList or a Table/Query? Would
an OptionsGroup work as well?

Hi
I've a number of combo boxes bound to a form.

Each combo box has an AfterUpdate event which sets the focus to another
combo box and disables the current box.

Thats all fine when the user clicks YES/NO as per the options but when
they type in something else the focus seems to go elsewhere.

I can see on a command box how the 'Err' command works but how would
this work on a combo box.

code example below:

Combo40_Afterupdate()

if combo40.value <> "" then

combo50.enabled = true
combo50.setfocus

combo40.enabled = false

end if

end sub

where would i insert the err command.

regards

chris

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 

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