By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,136 Members | 1,806 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,136 IT Pros & Developers. It's quick & easy.

Listbox gotfocus error that is driving me mad

P: n/a
Jim
I really hope someone can help me with the below problem. It's driving
me insane.

I have a form with two combo boxes (say, combo1 and combo2) and a list
box (listbox1). When the user selects a value in combo1, the
AfterUpdate event kicks in, does some stuff, and moves focus to
combo2. The code looks something like this:

Private Sub combo1_AfterUpdate
'do stuff
combo2.SetFocus
End Sub

However, when the debugger gets to the line combo2.SetFocus, it goes
off and runs listbox1_GotFocus (which has its own sub that i do not
want running).

There is simply no reference anywhere to call this sub and I it's
really starting to baffle me. I've tried deleting and readding the
controls, amongst other things, and I can only assume it's yet another
Microsoft bug.

Any help would be greatly appreciated

Jim
Nov 12 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
goto your code module and do a Find (ctrl H) for every occurence of
"combo2" (or the actual name of your 2nd combobox). By default, the
Find (replace) dialog box is set to look in the current module. Just
type combo2 (or rather the actual name of your combobox) and click on
Find/Find Next. You may have sub for the Enter event or GotFocus Event
for combo2 which is telling it to setfocus to your listbox as soon as
combo2 gets the focus. If that isn't it, then try Repair/Compacting
your database. If that doesn't do it then I would create a new form and
copy all your stuff over to it minus the listbox and run the form. If
there is a problem you will get an error. Note: I would copy your
stuff to a new form for safety and do your testing on the new form. I
do this all the time. When ever you test something, always test the
copy.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #2

P: n/a
first try to remark all "staff", leave only setfocus, and see if it start
working
if no - then try to post all code from your form here

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
"Jim" <js*****@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
I really hope someone can help me with the below problem. It's driving
me insane.

I have a form with two combo boxes (say, combo1 and combo2) and a list
box (listbox1). When the user selects a value in combo1, the
AfterUpdate event kicks in, does some stuff, and moves focus to
combo2. The code looks something like this:

Private Sub combo1_AfterUpdate
'do stuff
combo2.SetFocus
End Sub

However, when the debugger gets to the line combo2.SetFocus, it goes
off and runs listbox1_GotFocus (which has its own sub that i do not
want running).

There is simply no reference anywhere to call this sub and I it's
really starting to baffle me. I've tried deleting and readding the
controls, amongst other things, and I can only assume it's yet another
Microsoft bug.

Any help would be greatly appreciated

Jim

Nov 12 '05 #3

P: n/a
Jim
Alex

Thanks for your reply. There are no other events, and no references
whatsoever to the combos or listboxes anywhere in the code.

Jim

"Alex Dybenko" <al**@PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message
news:O9****************@TK2MSFTNGP12.phx.gbl...
first try to remark all "staff", leave only setfocus, and see if it start
working
if no - then try to post all code from your form here

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
"Jim" <js*****@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
I really hope someone can help me with the below problem. It's driving
me insane.

I have a form with two combo boxes (say, combo1 and combo2) and a list
box (listbox1). When the user selects a value in combo1, the
AfterUpdate event kicks in, does some stuff, and moves focus to
combo2. The code looks something like this:

Private Sub combo1_AfterUpdate
'do stuff
combo2.SetFocus
End Sub

However, when the debugger gets to the line combo2.SetFocus, it goes
off and runs listbox1_GotFocus (which has its own sub that i do not
want running).

There is simply no reference anywhere to call this sub and I it's
really starting to baffle me. I've tried deleting and readding the
controls, amongst other things, and I can only assume it's yet another
Microsoft bug.

Any help would be greatly appreciated

Jim


Nov 12 '05 #4

P: n/a
well, in this case i can just suggest to recreate form again
--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
"Jim" <ji**********@nospam.virgin.net> wrote in message
news:2tv_b.1296$ta.1114@newsfe1-win...
Alex

Thanks for your reply. There are no other events, and no references
whatsoever to the combos or listboxes anywhere in the code.

Jim

"Alex Dybenko" <al**@PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message
news:O9****************@TK2MSFTNGP12.phx.gbl...
first try to remark all "staff", leave only setfocus, and see if it start working
if no - then try to post all code from your form here

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
"Jim" <js*****@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
I really hope someone can help me with the below problem. It's driving
me insane.

I have a form with two combo boxes (say, combo1 and combo2) and a list
box (listbox1). When the user selects a value in combo1, the
AfterUpdate event kicks in, does some stuff, and moves focus to
combo2. The code looks something like this:

Private Sub combo1_AfterUpdate
'do stuff
combo2.SetFocus
End Sub

However, when the debugger gets to the line combo2.SetFocus, it goes
off and runs listbox1_GotFocus (which has its own sub that i do not
want running).

There is simply no reference anywhere to call this sub and I it's
really starting to baffle me. I've tried deleting and readding the
controls, amongst other things, and I can only assume it's yet another
Microsoft bug.

Any help would be greatly appreciated

Jim



Nov 12 '05 #5

P: n/a
Jim
That helps. I'll put it down to an MS bug.

Thanks
Jim

"Alex Dybenko" <al**@PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message news:<u4**************@TK2MSFTNGP09.phx.gbl>...
well, in this case i can just suggest to recreate form again
--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
"Jim" <ji**********@nospam.virgin.net> wrote in message
news:2tv_b.1296$ta.1114@newsfe1-win...
Alex

Thanks for your reply. There are no other events, and no references
whatsoever to the combos or listboxes anywhere in the code.

Jim

"Alex Dybenko" <al**@PLEASE.cemi.NO.rssi.SPAM.ru> wrote in message
news:O9****************@TK2MSFTNGP12.phx.gbl...
first try to remark all "staff", leave only setfocus, and see if it start working
if no - then try to post all code from your form here

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com
"Jim" <js*****@hotmail.com> wrote in message
news:5c**************************@posting.google.c om...
> I really hope someone can help me with the below problem. It's driving
> me insane.
>
> I have a form with two combo boxes (say, combo1 and combo2) and a list
> box (listbox1). When the user selects a value in combo1, the
> AfterUpdate event kicks in, does some stuff, and moves focus to
> combo2. The code looks something like this:
>
> Private Sub combo1_AfterUpdate
> 'do stuff
> combo2.SetFocus
> End Sub
>
> However, when the debugger gets to the line combo2.SetFocus, it goes
> off and runs listbox1_GotFocus (which has its own sub that i do not
> want running).
>
> There is simply no reference anywhere to call this sub and I it's
> really starting to baffle me. I've tried deleting and readding the
> controls, amongst other things, and I can only assume it's yet another
> Microsoft bug.
>
> Any help would be greatly appreciated
>
> Jim


Nov 12 '05 #6

P: n/a

"wuqiang" <wu*****@hotmail.com> ????
news:5c**************************@posting.google.c om...
I really hope someone can help me with the below problem. It's driving
me insane.

I have a form with two combo boxes (say, combo1 and combo2) and a list
box (listbox1). When the user selects a value in combo1, the
AfterUpdate event kicks in, does some stuff, and moves focus to
combo2. The code looks something like this:

Private Sub combo1_AfterUpdate
'do stuff
combo2.SetFocus
End Sub

However, when the debugger gets to the line combo2.SetFocus, it goes
off and runs listbox1_GotFocus (which has its own sub that i do not
want running).

There is simply no reference anywhere to call this sub and I it's
really starting to baffle me. I've tried deleting and readding the
controls, amongst other things, and I can only assume it's yet another
Microsoft bug.

Any help would be greatly appreciated

wuqiang

Nov 12 '05 #7

P: n/a

"wuqiang" <wu*****@hotmail.com> ????
news:5c**************************@posting.google.c om...
I really hope someone can help me with the below problem. It's driving
me insane.

I have a form with two combo boxes (say, combo1 and combo2) and a list
box (listbox1). When the user selects a value in combo1, the
AfterUpdate event kicks in, does some stuff, and moves focus to
combo2. The code looks something like this:

Private Sub combo1_AfterUpdate
'do stuff
combo2.SetFocus
End Sub

However, when the debugger gets to the line combo2.SetFocus, it goes
off and runs listbox1_GotFocus (which has its own sub that i do not
want running).

There is simply no reference anywhere to call this sub and I it's
really starting to baffle me. I've tried deleting and readding the
controls, amongst other things, and I can only assume it's yet another
Microsoft bug.

Any help would be greatly appreciated

wuqiang

Nov 12 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.