Expected user-defined type, not project

Hello,
 I get this error in my form on_load event "The expression On Load you entered as the event property setting produced the following error:Expected user-defined type, not project"

I don't remember this happening last night, so i don't know what I changed.  This error even happens when I comment out the whole form's onload event.

Please help.

Whatever.
whatever080697Asked:
Who is Participating?
 
BillystyxCommented:
Not sure if this is it, but when you go to the form properties in design view, do you see an event procedure next to the load event in properties?
If not, copy your code out of the onload event, and delete it all and then go through the property inspector click on the drop down box next to load event and select code editor and then paste your code back in there.

Billystyx
0
 
flavoCommented:
hmm.. if there is NO code there (all commented out) i'd say its corupt.  

Try to do a compile (in VBE debug-> compile)
try deleteing all the code from the form_load (copy it into word of something??) and compile.. then put it back
if that doesnt work...
if that doesnt work....
Try importing all objects into a new access container.
0
 
whatever080697Author Commented:
I figured out the problem. I used a variable name that must have been a reserved word.  rsReservations must be reserverd.  

This is not either of  your propsed sollutions so how should I handle this??

whatever
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
flavoCommented:
rsReservations -> reserved word??? I dont think so....

Maybe you declared it wrong??
0
 
whatever080697Author Commented:
This line causes the error

Dim rsReservations As ADODB
0
 
flavoCommented:
Dim rsReservations As ADODB.Recordset
0
 
BillystyxCommented:
what did you actually do to get it back on track?
(I agree with flavo here - rsReservations is not a reserved word)
Billystyx
0
 
BillystyxCommented:
that'd be it, good work flavo:)

Billystyx
0
 
whatever080697Author Commented:
Ok. I was wrong again! :-)

I needed to declare it as ADODB.Recordset.

Stupid error.

0
 
flavoCommented:
Glad to help mate!

Good luck with the rest of your project

Dave :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.