Link to home
Start Free TrialLog in
Avatar of pwdells
pwdellsFlag for United States of America

asked on

Updating Splash Screen During Data Import Process

Hi Experts,

I have an import process that imports data from tabs in an Excel file.  That works.  But what my client wants is a splash screen saying what tables are being appended to when it's happening.  

If I create a splash screen and call that screen prior to the import process.  How do I get my original window to post to the screen during the import process?  So how do I write to a form from another form?

Thank you ,

Wendee
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Use the Load event of the splash screen to run your import process.

Put a label control (lbl_Status) on your splash form and set its visible property to No.

In the Load event of the form, do something like:

Private Sub Form_Load

    Dim strWorkbook as string

    me.visible = true

    me.lbl_Status.Visible = true

    strWorkbook = "C:\somefolder\somefile1.xls"
    me.lbl_Status.Caption = "Importing worksheet:" & strWorkbook
    docmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "tbl_Dest", strWorkbook, true

    strWorkbook = "C:\somefolder\somefile2.xls"
    me.lbl_Status.Caption = "Importing worksheet:" & strWorkbook
    docmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "tbl_Dest", strWorkbook, true
 
    strWorkbook = "C:\somefolder\somefile3.xls"
    me.lbl_Status.Caption = "Importing worksheet:" & strWorkbook
    docmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "tbl_Dest", strWorkbook, true

    me.lbl_Status.visible = false

End Sub
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pwdells

ASKER

I had to find a different solution to this problem.  I will update tonight, when I get home to my personal laptop to post my solution.