Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database problems

Status
Not open for further replies.

bgfs

Technical User
Apr 6, 2005
130
GB
I'm trying to use the data form wizard to create a form to connect to a simple Access 2000 database using VB6 Service Pack 6. The form seems to create ok but when run it comes up with "Compile error: Procedure eclaration does not match description of event or procedure having same name" Anybody got any ideas?
Thanks
 
I'm trying to use the data form wizard to create a form to connect to a simple Access 2000 database using VB6 Service Pack 6."

Is there really a "data form wizard" in VB6? Could you please tell me how to open it?
 
Go to Menu Project|Add Form and select VB Data Form Wizard

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Usually this happens with the Event Declaration for a control array.
When you have a control array in your form, and you are not passing the Control's Index on to your event, this could happen. It can also happen the other way, when you have Index passed to a Control's Event, which is actually not a control array.

If it is the first case, Just put "Index As Integer" as the first argument. Ex, if it is a textbox's KeyPress event, change it to something like this.

Refer below code and change existing event declaration..

Code:
[b][red]Case 1[/red][/b]
[blue]

Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)

End Sub

Private Sub Command1_Click(Index As Integer)

End Sub
[/blue]
[b][red]Case 2[/red][/b]
[blue]
Private Sub Text1_KeyPress(KeyAscii As Integer)

End Sub

Private Sub Command1_Click()

End Sub
[/blue]

But VB usually highlights the area where the error has occured (When you are running in IDE). Do you see that?

------------------------------------------
The faulty interface lies between the chair and the keyboard.
 
<Go to Menu Project|Add Form and select VB Data Form Wizard
Or go to Tools/AddIn Manager, click on VB 6 Data Form Wizard and check Loaded. Then go to the Addins menu and select it. While this is more long winded than johnwm's solution, there are lots of other addins you can use this way, so it's well for you to know it. In fact, if you get extremely ambitious somewhere down the line, you can also build your own.

Bob
 
Thanks it did the trick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top