General discussion

Locked

Run code on an Excel spreadsheet

By hurdk ·
I have an Excel spreadsheet.
I pasted a button on the spreadsheet.
I copied code to the button.
I need to know how to run the code.
Thank you.

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Run code on an Excel spreadsheet

by DKlippert In reply to Run code on an Excel spre ...

Create the button using the Form toolbar. A dialog will appear to assign a macro to run on button click

Collapse -

Run code on an Excel spreadsheet

by hurdk In reply to Run code on an Excel spre ...

I need to execute instructions such as

Dim dbs As database
Dim strSQL As String
Dim fld As Field
Dim rs1 As Recordset
On Error Resume Next
Set dbs = CurrentDb()
fld.Attributes = dbAutoIncrField
With tdf
.Fields.Append.CreateField("PersonID,dbLong")
End With

strSQL = "SELECT PersonID FROM .. ORDER ... "
DoCmd.RunSQL (strSQL)



I get errors with this type of coding

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums