Posted by: CyberNerd

Error - 05/26/02 05:11 AM

Im a total newbie programmer and although im sure it wasnt the best choice i picked visual basic to be my first language. Im using microsoft visual studio 6.0 and a book called Starting with visual basic, im doing a practice lesson right out of the book and I wrote everything correctly and i keep getting a compiling error with one line

Private Sub Form_Load()

i have the smallest bit of knowledge possible on the subject but unless i find out whats going on i cant progress. so my question is, does anyone know whats going on?
Posted by: SilentRage

Re: Error - 05/26/02 02:10 PM

that line is not the line you're getting an error on. When you execute the program from within VB, it first goes to the Form_Load section and compiles it for execution. But it detected an error and could not compile - so it it showed you the section (procedure) that it had a problem with. But there should also be another word or line that is highlighted and a error message discribing what's wrong. Post the error message and I'll explain what it means.
Posted by: CyberNerd

Re: Error - 05/26/02 04:18 PM


Ambiguous name detected: Form_Load
Posted by: SilentRage

Re: Error - 05/27/02 05:08 PM

Well isn't that peculiar. I gotta take 2 minutes to go lookup the error for a description in the MSDN...

"More than one object in the same scope may have elements with the same name. Qualify the element name by including the object name and a period."

Actually, it took me 1.5 minutes. Ahem...

The problem may be that you have "Private Sub Form_Load()" more than once. Or maybe you have "Form_Load" more than once in your code used as variables or something. This fact may be hidden from you. Open the code window and look at the two buttons at the lower left corner of the code panel. If you hover your mouse over the left button, it'll say "Procedure View", the other being "Full Module View". You want "Full Module View" button to be pressed down. The duplicate code could also be in a module (a module is for raw code which isn't "contained" in a window)

If you STILL can't solve it, then open your Form1.frm file in notepad (or whatever you named your form file). Copy the entire contents and paste them into a post.
Posted by: CyberNerd

Re: Error - 05/27/02 08:48 PM

ok, thanks thats a step in the right direction