"Combos with Tens of Thousands of Records"

DuMont

Registered User.
Local time
Today, 11:43
Joined
Jul 31, 2014
Messages
24
Hi Guys,

I'm trying to follow Allen Browne's - Combos with Tens of Thousands of Records (http://allenbrowne.com/ser-32.html)

However, I keep getting the error...
Compile Error:
Invalid use of Me keyword
(This being a new module)

That's how it shows in his code (the use of me.comboname.rowsource) but it's not working for me.

Any idea why?
 
That's how it shows in his code (the use of me.comboname.rowsource) but it's not working for me.

Any idea why?
Did you replace the "comboname" with the name of your combobox?
 
Originally Posted by JHB
Did you replace the "comboname" with the name of your combobox
Yes I did do that...
 
Then let us see your code! What is the name of your combobox?
 
I think . is wrong. try

me!comboname.recordsource

or even just leave the me off altogether

If me. is correct, you should see comboname in the intellisense ....
 
I think . is wrong. try

me!comboname.recordsource

or even just leave the me off altogether

If me. is correct, you should see comboname in the intellisense ....
You know, the only time I use ! is in queries, forms, and reports. I prefer never to use it in VBA. Would much prefer to pick up as many coding errors as possible at compile time rather than run-time.
 
It looks like we all overlooked this point -->
Invalid use of Me keyword
(This being a new module)
All the code should be pasted in the form's module, not a Module, not a Class Module but the module of the form itself.

Me. only works when it's used inside the form's module.

Step 1 in Allen Browne's link clearly states:
"Step 1: Paste this into the General Declarations section of your form's module"
 

Users who are viewing this thread

Back
Top Bottom