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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Private Sub Command100_Click() FAILS

Status
Not open for further replies.

sharkchaser

Technical User
Mar 19, 2010
50
US
When I click the button on the form NOTHING HAPPENS at all!

This same code works in many other form buttons I have.

I'm totally lost as to why.

Thanks . . . Rick

Code:
Private Sub Command100_Click()
'LA QUINTA
On Error Resume Next
Kill "D:\flw\Access\YTD\qryLaQuintaProg.xls"
On Error GoTo 0
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2003, "qryLaQuinta.xls", "D:\flw\Access\YTD", True
MsgBox "Finished Exporting La Quinta YTD to D:\FLW\Access\YTD"
End Sub
 
Okay . . I found this in the drop down list for commands

Private Sub Command100_Click___Click()

End Sub

Don't know where it came from but it had to be me!

I can't delete it.

It keeps returning after I delete and save.

This must be the confusion as the below is valid with my code as shown in the prior post.

Private Sub Command100_Click()
End Sub

How do I delete that

 
Could be the control name has changed to "Command100_Click__"?
Try renaming it to something useful like "cmdDelete" or "btnDelete". If that doesn't work, try compact & repair.

Ni neart go cur le cheile.
 
Thanks Everyone . . .

What I had to do is copy the code.

Delete the button on the form.

Create a new button.

Paste in the code.

It worked flawlessly.

It suspect it was the fact that I could not delete/remove the confusing Private Sub Command100_Click___Click() as genomon suggesed.

I have no knowledge of "cmdDelete" or "btnDelete" or renaming buttons as I've tried in the past and it never worked for me.

Thanks.

Rick
 
Open the property sheet for the control (command button). In the "Name" property, delete the old & type in the new.

Ni neart go cur le cheile.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top