vba code

bruggied

New member
Local time
Today, 13:18
Joined
May 11, 2012
Messages
7
Hello,

i use this code to import xls file in access

Sub ImportXLS()
' importeer xls bestand
Dim WrksheetName As String
Dim i As Integer
Dim xl As Object
Set xl = CreateObject("Excel.Application")
xl.Visible = True
xl.Workbooks.Open "C:\david\axor\01-mavo2409.xlsx"
With xl
.Visible = True
With .Workbooks(.Workbooks.Count)
For i = 1 To .Worksheets.Count
WrksheetName = .Worksheets(i).Name
DoCmd.TransferSpreadsheet (acImport), acSpreadsheetTypeExcel9, WrksheetName, "C:\david\axor\01-mavo2409.xlsx", True
Next i
End With
End With
Set xl = Nothing
End Sub

the WrksheetName is mavo2409, i want to create a vba code that add a record to an existing database _match where the new record has the value mavo2409.
 
And what have you tried?
What is your plan to add this new record?
Is this a one-time add of a record, or is this likely to be a recurring need?

You haven't given us much info. Perhaps you could tell us more of your
-knowledge of Access; vba; sql....

something to help us help you.

You could try Google using "vba code to add a record to an access table"
 

Users who are viewing this thread

Back
Top Bottom