[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Progress / Status Meter for Query Export to Excel

Asked by lightcross in Microsoft Access Database

Tags: excel, meter

Hi All,

Currently I have code that exports a query result to an excel sheet.  My problem is that sometimes this export can take lots of time.  I would like if I can give the user some kind of status saying that it is still working or an actual progress meter with 0%-100% would be even better.  Any Suggestions?

 The code is as follows:

'*********** FORM CODE
Private Sub Command29_Click()
Dim strSQL As String
Dim strDateIn As String, strDateEnd As String

strDateIn = "#" & Me.tbSTARTDATE & "#"
strDateEnd = "#" & Me.tbENDDATE & "#"

If "" & strDateIn = "" Then  ' Is null or zero length
    MsgBox "YOU MUST ENTER A VALUE IN BOTH FIELDS", vbCritical
        Exit Sub
End If
If "" & strDateEnd = "" Then  ' Is null or zero length
    MsgBox "YOU MUST ENTER A VALUE IN BOTH FIELDS", vbCritical
        Exit Sub
End If

strSQL = "SELECT [tblDieLevelInfo].[LotID], [tblDieLevelInfo].[WaferID], [tblDieLevelInfo].[DieID], [qryCrossIL].[TestType], [qryCrossPDL].[DateTimeTested], [qryCrossIL].[5] AS [Max IL Ch5], [qryCrossIL].[6] AS [Max IL Ch6], [qryCrossIL].[7] AS [Max IL Ch7], [qryCrossIL].[8] AS [Max IL Ch8], [qryCrossPDL].[5] AS [Max PDL Ch5], [qryCrossPDL].[6] AS [Max PDL Ch6], [qryCrossPDL].[7] AS [Max PDL Ch7], [qryCrossPDL].[8] AS [Max PDL Ch8] " _
& " FROM (((tblDieLevelInfo INNER JOIN tblDieStepDetailsData ON [tblDieLevelInfo].[DieLevelID]=[tblDieStepDetailsData].[DieLevelID]) INNER JOIN tblDieOpticalTestResultsPassive ON [tblDieStepDetailsData].[DieStepDetailsID]=[tblDieOpticalTestResultsPassive].[DieStepDetailsID]) INNER JOIN qryCrossIL ON [tblDieStepDetailsData].[DieStepDetailsID]=[qryCrossIL].[DieStepDetailsID]) INNER JOIN qryCrossPDL ON [tblDieStepDetailsData].[DieStepDetailsID]=[qryCrossPDL].[DieStepDetailsID]" _
& " GROUP BY [tblDieStepDetailsData].[DieStepDetailsID], [tblDieLevelInfo].[LotID], [tblDieLevelInfo].[WaferID], [tblDieLevelInfo].[DieID], [qryCrossIL].[TestType], [qryCrossPDL].[DateTimeTested], [qryCrossIL].[5], [qryCrossIL].[6], [qryCrossIL].[7], [qryCrossIL].[8], [qryCrossPDL].[5], [qryCrossPDL].[6], [qryCrossPDL].[7], [qryCrossPDL].[8] " _
& " HAVING (((qryCrossIL.TestType)=""Passive test post arc"") AND ((qryCrossPDL.DateTimeTested) Between " & strDateIn & "  And " & strDateEnd & ")) " _
& " ORDER BY [tblDieLevelInfo].[LotID], [tblDieLevelInfo].[WaferID], [tblDieLevelInfo].[DieID]; "

' see "module code below" for function "exporttoexcel"
  ExportToExcel strSQL
End Sub

'******** MODULE CODE
Public Function ExportToExcel(pstrSQL As String)
On Error GoTo err_handle
Dim objExcel As Excel.Application
Dim exlBook As Excel.Workbook
Dim exlSheet As Excel.Worksheet
Dim exlRange As Excel.Range

Dim rec As Recordset
Dim DB As Database
Dim fld As Field
Dim intCol As Integer

Set DB = CurrentDb()
Set rec = DB.OpenRecordset(pstrSQL, dbOpenSnapshot)

Set objExcel = New Excel.Application
Set exlBook = objExcel.Workbooks.Add
Set exlSheet = exlBook.Worksheets(1)
Set exlRange = exlSheet.Range("A1")
intCol = 1
For Each fld In rec.Fields
    exlRange.Cells(1, intCol) = fld.Name
    intCol = intCol + 1
Next
Set exlRange = exlSheet.Range("A2")
exlRange.CopyFromRecordset rec

objExcel.Visible = True
objExcel.WindowState = vbMaximizedFocus
objExcel.Cells.EntireColumn.AutoFit
err_handle:
Set exlRange = Nothing
Set exlSheet = Nothing

End Function
[+][-]03/29/06 04:34 PM, ID: 16328166Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Microsoft Access Database
Tags: excel, meter
Sign Up Now!
Solution Provided By: harfang
Participating Experts: 1
Solution Grade: A
 
[+][-]03/28/06 03:41 PM, ID: 16316356Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/28/06 10:39 PM, ID: 16318702Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/29/06 02:21 AM, ID: 16319767Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/29/06 07:34 AM, ID: 16322617Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/29/06 10:58 AM, ID: 16324914Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/29/06 01:46 PM, ID: 16326893Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/30/06 11:09 AM, ID: 16335595Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/30/06 04:33 PM, ID: 16338345Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/30/06 07:30 PM, ID: 16339200Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/30/06 11:31 PM, ID: 16340232Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03/31/06 07:40 AM, ID: 16343424Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/31/06 07:42 AM, ID: 16343448Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93