PC Review
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Combo / OGrid / SendMessage woes
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Combo / OGrid / SendMessage woes
![]() |
Combo / OGrid / SendMessage woes |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi folks
Access uses the OGrid class for the dropped-down list of a combo box. Say the user moves the mouse to an entry in the dropped-down list, then clicks it to select that entry. The combo box's MouseDown event occurs. I need to determine which entry the user clicked from that list - then CANCEL the click, because the combo's controlsource (not rowsource) is actually bound to a function. I can easily cancel the click - docmd.cancelevent works fine - but I can not figure how to get the selected entry using APIs. I know that Access combo boxes are heavily subclassed, & do not necessarily respond to many (most? all?) of the normal SendMessage calls. So, my question, to anyone who understands what I am talking about, is this: "Is it possible? If so, how?" ! TIA, TC |
|
|
|
#2 |
|
Guest
Posts: n/a
|
It seems strange the hoops you are jumping through but I'm sure you must
have your reasons. Also you would have to include logic to handle when the Keyboard is use to navigate/select a row in the control. I'll leave the column calculations to you but here is a solution to determine the current highlighted row of a ComboBox control. http://www.lebans.com/combocurrentrow.htm -- HTH Stephen Lebans http://www.lebans.com Access Code, Tips and Tricks Please respond only to the newsgroups so everyone can benefit. "TC" <a@b.c.d> wrote in message news:1075694307.885118@teuthos... > Hi folks > > Access uses the OGrid class for the dropped-down list of a combo box. Say > the user moves the mouse to an entry in the dropped-down list, then clicks > it to select that entry. The combo box's MouseDown event occurs. > > I need to determine which entry the user clicked from that list - then > CANCEL the click, because the combo's controlsource (not rowsource) is > actually bound to a function. I can easily cancel the click - > docmd.cancelevent works fine - but I can not figure how to get the selected > entry using APIs. > > I know that Access combo boxes are heavily subclassed, & do not necessarily > respond to many (most? all?) of the normal SendMessage calls. > > So, my question, to anyone who understands what I am talking about, is this: > "Is it possible? If so, how?" ! > > TIA, > TC > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Stephen, thank you very much for your reply. I had actually drafted an email
to you, to see if you would quote on writing the code in question. But I thought that I would give the newsgroups one try, first. === YEA FOR NEWSGROUPS! === Let me know (now or in future) if there is anything that I can do for you in return. Probably that would NOT include, writing screen management API code !! Thanks again, TC "Stephen Lebans" <ForEmailGotoMy.WebSite.-WWWdotlebansdotcom@linvalid.com> wrote in message news:OzHusud6DHA.2416@TK2MSFTNGP10.phx.gbl... > It seems strange the hoops you are jumping through but I'm sure you must > have your reasons. Also you would have to include logic to handle when > the Keyboard is use to navigate/select a row in the control. > > I'll leave the column calculations to you but here is a solution to > determine the current highlighted row of a ComboBox control. > http://www.lebans.com/combocurrentrow.htm > > -- > > HTH > Stephen Lebans > http://www.lebans.com > Access Code, Tips and Tricks > Please respond only to the newsgroups so everyone can benefit. > > > "TC" <a@b.c.d> wrote in message news:1075694307.885118@teuthos... > > Hi folks > > > > Access uses the OGrid class for the dropped-down list of a combo box. > Say > > the user moves the mouse to an entry in the dropped-down list, then > clicks > > it to select that entry. The combo box's MouseDown event occurs. > > > > I need to determine which entry the user clicked from that list - then > > CANCEL the click, because the combo's controlsource (not rowsource) is > > actually bound to a function. I can easily cancel the click - > > docmd.cancelevent works fine - but I can not figure how to get the > selected > > entry using APIs. > > > > I know that Access combo boxes are heavily subclassed, & do not > necessarily > > respond to many (most? all?) of the normal SendMessage calls. > > > > So, my question, to anyone who understands what I am talking about, is > this: > > "Is it possible? If so, how?" ! > > > > TIA, > > TC > > > > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Thanks TC. I wrote it because of all of the good work you do in the
NG's! :-) -- HTH Stephen Lebans http://www.lebans.com Access Code, Tips and Tricks Please respond only to the newsgroups so everyone can benefit. "TC" <a@b.c.d> wrote in message news:1075777908.899721@teuthos... > Stephen, thank you very much for your reply. I had actually drafted an > to you, to see if you would quote on writing the code in question. But I > thought that I would give the newsgroups one try, first. > > === YEA FOR NEWSGROUPS! === > > Let me know (now or in future) if there is anything that I can do for you in > return. Probably that would NOT include, writing screen management API code > !! > > Thanks again, > TC > > > "Stephen Lebans" <ForEmailGotoMy.WebSite.-WWWdotlebansdotcom@linvalid.com> > wrote in message news:OzHusud6DHA.2416@TK2MSFTNGP10.phx.gbl... > > It seems strange the hoops you are jumping through but I'm sure you must > > have your reasons. Also you would have to include logic to handle when > > the Keyboard is use to navigate/select a row in the control. > > > > I'll leave the column calculations to you but here is a solution to > > determine the current highlighted row of a ComboBox control. > > http://www.lebans.com/combocurrentrow.htm > > > > -- > > > > HTH > > Stephen Lebans > > http://www.lebans.com > > Access Code, Tips and Tricks > > Please respond only to the newsgroups so everyone can benefit. > > > > > > "TC" <a@b.c.d> wrote in message news:1075694307.885118@teuthos... > > > Hi folks > > > > > > Access uses the OGrid class for the dropped-down list of a combo box. > > Say > > > the user moves the mouse to an entry in the dropped-down list, then > > clicks > > > it to select that entry. The combo box's MouseDown event occurs. > > > > > > I need to determine which entry the user clicked from that list - then > > > CANCEL the click, because the combo's controlsource (not rowsource) is > > > actually bound to a function. I can easily cancel the click - > > > docmd.cancelevent works fine - but I can not figure how to get the > > selected > > > entry using APIs. > > > > > > I know that Access combo boxes are heavily subclassed, & do not > > necessarily > > > respond to many (most? all?) of the normal SendMessage calls. > > > > > > So, my question, to anyone who understands what I am talking about, is > > this: > > > "Is it possible? If so, how?" ! > > > > > > TIA, > > > TC > > > > > > > > > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Thanks for the compliment!
Your code works fine for my purpose. TC "Stephen Lebans" <ForEmailGotoMy.WebSite.-WWWdotlebansdotcom@linvalid.com> wrote in message news:OOVi1Hh6DHA.2044@TK2MSFTNGP10.phx.gbl... > Thanks TC. I wrote it because of all of the good work you do in the > NG's! > :-) > -- > > HTH > Stephen Lebans > http://www.lebans.com > Access Code, Tips and Tricks > Please respond only to the newsgroups so everyone can benefit. > > > "TC" <a@b.c.d> wrote in message news:1075777908.899721@teuthos... > > Stephen, thank you very much for your reply. I had actually drafted an > > to you, to see if you would quote on writing the code in question. But > I > > thought that I would give the newsgroups one try, first. > > > > === YEA FOR NEWSGROUPS! === > > > > Let me know (now or in future) if there is anything that I can do for > you in > > return. Probably that would NOT include, writing screen management API > code > > !! > > > > Thanks again, > > TC > > > > > > "Stephen Lebans" > <ForEmailGotoMy.WebSite.-WWWdotlebansdotcom@linvalid.com> > > wrote in message news:OzHusud6DHA.2416@TK2MSFTNGP10.phx.gbl... > > > It seems strange the hoops you are jumping through but I'm sure you > must > > > have your reasons. Also you would have to include logic to handle > when > > > the Keyboard is use to navigate/select a row in the control. > > > > > > I'll leave the column calculations to you but here is a solution to > > > determine the current highlighted row of a ComboBox control. > > > http://www.lebans.com/combocurrentrow.htm > > > > > > -- > > > > > > HTH > > > Stephen Lebans > > > http://www.lebans.com > > > Access Code, Tips and Tricks > > > Please respond only to the newsgroups so everyone can benefit. > > > > > > > > > "TC" <a@b.c.d> wrote in message news:1075694307.885118@teuthos... > > > > Hi folks > > > > > > > > Access uses the OGrid class for the dropped-down list of a combo > box. > > > Say > > > > the user moves the mouse to an entry in the dropped-down list, > then > > > clicks > > > > it to select that entry. The combo box's MouseDown event occurs. > > > > > > > > I need to determine which entry the user clicked from that list - > then > > > > CANCEL the click, because the combo's controlsource (not > rowsource) is > > > > actually bound to a function. I can easily cancel the click - > > > > docmd.cancelevent works fine - but I can not figure how to get the > > > selected > > > > entry using APIs. > > > > > > > > I know that Access combo boxes are heavily subclassed, & do not > > > necessarily > > > > respond to many (most? all?) of the normal SendMessage calls. > > > > > > > > So, my question, to anyone who understands what I am talking > about, is > > > this: > > > > "Is it possible? If so, how?" ! > > > > > > > > TIA, > > > > TC > > > > > > > > > > > > > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

