Hi Larry,
Yes, I've searched around quite a bit. I only found one other person
wondering about the "2". The most informative code snippets and discussions
I've found were these:
http://www.mvps.org/access/forms/frm0049.htm
http://groups.google.com/[email protected]&rnum=2
I did not get any help from:
'
http://support.microsoft.com/?kbid=304252
'
http://support.microsoft.com/?kbid=281870
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/office04062000.asp
The reason that this issue is not apparent to most is (I'm guessing)
1) no one puts a case else in their select statements
2) no one uses the feature of being able to use the same code to handle
multiple combo boxes.
At least, I could NOT find any examples where the ID parameter to the
callback function was being used.
The reason I discovered this is:
1) I always put a case else statments on my select cases, even if it is
to just 'debug.assert false'
2) I'm trying to make my callback routine reusable by multiple combo
boxes, and understand the use of the ID parameter.
The documention suggests to me that if the value returned from a acLBOpen
call will be passed in on subsequent calls. I am finding that this is not
true. Rather, through guesswork and experimentation, I've discovered that
the value returned from the callback when passed code 2 is what is used.
!!
So, I'm getting SOME understanding, but not enough.
I am getting the combobox to work.... Just not (yet) with sufficient
understanding to trust using my callback routine with multiple comboboxes.
In case your interested, my custom callback is used to execute a
paramaterized stored procedure on SQL Server. But, before execution, it
"injects" values from global program state into the .parameters. It also
does what the default behaviour of Access combo boxes do, namely "inject"
values from controls on the current form (and recordset.fields). Thus, my
combo boxes are sensitive to both controls on the same form as they appear,
AND global state (And they prompt the user if any parameters remain unbound
after these "injection"). I hope you can see the value of making this
generic across combo boxes.
If you're still with me... I have a concern with my approach as it relates
to instancing of forms. It appears to me that when I have multiple
instances of a form displayed, they are all using the same combo box, so,
if they are parameterized differently they will still change in lock step
with one another. This would be a problem regardless of whether I use a
callback or not. Does this make sense to you?
To summarize: None of the examples I've discovered make any use of the ID
parameter, which usage seems tte require understanding of the 2 code. This
is fine if your callback is particular to the control. Mine is not, and so
I'm trying to get this feature to work for me.
Any light you can shed would be appreciated.
Thanks,
Malcolm Cook
..