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

VBA with Excel

Status
Not open for further replies.

Wallegator

Programmer
Jan 3, 2001
58
US
I have data in an Excel spreadsheet that I want to create a new record for in an Access table. I can get the Access database and the table open but I can't figure out which VBA command to use to tell Access to add a record and add the Excel data. I know that I can use Add-Ins to do this but my client wants to do it with VBA and a command button. Thank you in advance for any help. My existing "working" code is shown below.

Set appAccess = CreateObject("Access.Application.9")
appAccess.OpenCurrentDatabase "c:\myfolder\mydatabase.mdb"
appAccess.DoCmd.OpenTable ("MyTable")
appAccess.Visible = True
 
Try this

AppAccess.CurrentDb.Execute "INSERT ...... etc. etc.

Durkin
alandurkin@bigpond.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top