Author Archive

Creating a new table in an external database using code

I often wondered how to do this - especially if you needed a new table with an Autonumber ID!  This is how I did it. (For some reason the line breaks refuse to display, and I’ve put in double breaks to be sure - I hope you can make it all out! Read the rest of this entry »

Viewing an Excel file from Access database

This is a useful little subroutine, as it opens a file (given as a parameter) into Excel, and displays it, without having to have the Excel reference set.  However, do make sure that the Microsoft DAO 3.6 Object Library is set.  It works with Access 2000 and later.

Sub OpenExcelFile(ExcelFileName) 
Dim xlApp as Object
Dim xlWorkBook as Object
Set xlApp = CreateObject(”Excel.Application”)
Set xlWorkbook = xlApp.Workbooks.Open(ExcelFileName)
xlApp.DisplayAlerts = False
xlApp.visible = True
End Sub

MS Access VBA Developer Code

Just to announce that I intend to use this space to put any interesting VB code I come across or use.  If anyone would like to contribute, then please do!

|