Import Process Screen

Hello,

I am in the process of building an import process screen.  I have the import code updating the lblStatus.caption as steps are completed.  However, when my lines reach the end of the label, it gets cut off.  I want the text to move upward.  So, when it is complete, it will show the last steps completed on the screen -- not the first steps.  

Here's my code:

    Dim objXL As Object
    Dim sTable, sFile As String, xlPath As String, i As Integer
    Dim strStats As String
   
    sFile = "DART 02-25-11.xlsx"
    xlPath = "C:\Users\w3nd33\Documents\Brantley\WIP Week 2011-13" & "\"
   
    strStats = "Opening Excel File: " & sFile & "..."
    Me.lblStatus.Caption = strStats
   
    Set objXL = CreateObject("Excel.Application")
    objXL.Workbooks.Open xlPath & sFile, , True
   
    With objXL
        'strStats = strStats & vbNewLine & " Importing " & .worksheets.Count & " Worksheets from " & .Name & " tab..."
        Me.lblStatus.Caption = strStats
        For i = 3 To .worksheets.Count
            strStats = strStats & vbNewLine & " Importing " & .worksheets(i).Name & " to the database..."
            Me.lblStatus.Caption = strStats
           ' DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
           '  .worksheets(i).Name, xlPath & sFile, True, .worksheets(i).Name & "!"
        Next
    End With
    objXL.Quit
    strStats = strStats & vbNewLine & " Data Import Complete..."
    Me.lblStatus.Caption = strStats
    Set objXL = Nothing
pwdellsAsked:
Who is Participating?
 
Jeffrey CoachmanMIS LiasonCommented:
Then use a Textbox, not a Label, to display this text.
Set the Can Grow property of the textbox to Yes.
0
 
pwdellsAuthor Commented:
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.
0
 
pwdellsAuthor Commented:
I know that I said that I did something differently.  However, I had this sort of function to build out again.  So, I decided to give BOAG a fair shake and try his suggestion / solution out.  It does work.  So, I apologize for a way too long response, nonetheless, it is a good solution.
0
 
Jeffrey CoachmanMIS LiasonCommented:
ok
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.