Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.
Public Function MYPREMLOAD() Dim strPath As String Dim appExcel As Excel.Application Dim strFolderPath As String Dim MyDB As DAO.Database Dim MyRS As DAO.Recordset Dim strSQL As String DoCmd.SetWarnings False strSQL = "Delete * From tblCustomer;" DoCmd.RunSQL strSQL DoCmd.SetWarnings True Set MyDB = CurrentDb() Set MyRS = MyDB.OpenRecordset("tblCustomer", dbOpenDynaset) 'strFolderPath = "C:\Customers\" 'strPath = "C:\Customers\*.xls" 'Set the path. strFolderPath = "X:\Special Risk\miketesting\POI\" strPath = "X:\Special Risk\miketesting\POI\*.xls" strPath = Dir(strPath, vbNormal) 'Retrieve the first entry. Set appExcel = CreateObject("Excel.Application") Do While strPath <> "" 'Initiate the loop appExcel.Workbooks.Open strFolderPath & strPath appExcel.Visible = True appExcel.Sheets("SR").Select With MyRS .AddNew !Policy = appExcel.Range("D2").Value !Effective = appExcel.Range("F2").Value !Yr = appExcel.Range("G2").Value !Premium = appExcel.Range("J2").Value .Update End With strPath = Dir 'Next entry Loop appExcel.Quit Set appExcel = Nothing MyRS.Close Set MyRS = Nothing MsgBox "This Process has completed!" End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.