Commands

  • Thread starter Thread starter Amateur
  • Start date Start date
A

Amateur

Dear Sirs
I'm executing with a command button on a form many commands.
Is there a possibility to show, with help of a "egg-watch" (I don't now the
correct word for it - it's just a litural translation from German), to show
when the commands are finished?

Thanks for any help
Klaus
 
If you are using a macro to execute your commands then place the line
Hourglass with the option of yes at the beginning and Hourglass with option
of No at the end.

If you are using VBA code then place
DoCmd.Hourglass True at the beginning of your routine and DoCmd.Hourglass
False at the end of the routine.

Be aware that if your code breaks with an error during your routines, your
cursor will remain as an hourglass unless you have an error trap to reset it.
 
Hi Dennis
thanks for helping me - I just have one problem because the hour glass
doesn't dissappear after finishing. I have the following code:
****************************************
Private Sub cmdTransfer_Click()

On Error GoTo Err_Handler

Dim strTargetDB As String
Dim strTargetTable As String
Dim strSQL As String

DoCmd.Hourglass True

strTargetDB = "C:\Documents and Settings\Klaus
Müller\Desktop\cps208web\transferdb.mdb"
strTargetTable = "webtotalbalancebie30p"

With CurrentDb

strSQL = _
"DELETE FROM [" & strTargetTable & "] " & _
"IN '" & _
strTargetDB & "';"

.Execute strSQL, dbFailOnError

strSQL = _
"INSERT INTO [" & strTargetTable & _
"](accountnumber, initialinvestment, guaranteedequity,
monthstartingbalance, optionpl, SumOfcontractvalue, optioncommission,
commission, managementfeebasic, Incentivefeetotal, electronicfee, vat,
adjustment, netliquidationbalance, paidoptionpremium, optionvalue,
SumOfopenpl, SumOfinitialmargin, SumOfmaintenancemargin, opentradebalance) IN
'" & _
strTargetDB & _
"' SELECT webtotalbalancebie30p.accountnumber,
webtotalbalancebie30p.initialinvestment,
webtotalbalancebie30p.guaranteedequity,
webtotalbalancebie30p.monthstartingbalance, webtotalbalancebie30p.optionpl,
webtotalbalancebie30p.SumOfcontractvalue,
webtotalbalancebie30p.optioncommission, webtotalbalancebie30p.commission,
webtotalbalancebie30p.managementfeebasic,
webtotalbalancebie30p.incentivefeetotal, webtotalbalancebie30p.electronicfee,
webtotalbalancebie30p.vat, webtotalbalancebie30p.adjustment,
webtotalbalancebie30p.netliquidationbalance,
webtotalbalancebie30p.paidoptionpremium, webtotalbalancebie30p.optionvalue,
webtotalbalancebie30p.SumOfopenpl, webtotalbalancebie30p.SumOfinitialmargin,
webtotalbalancebie30p.SumOfmaintenancemargin,
webtotalbalancebie30p.opentradebalance " & _
"FROM webtotalbalancebie30p;"


CurrentDb.Execute strSQL, dbFailOnError

End With
-------------------- the is a lot more and in the end I have
-------------------------
Exit_Point:
Exit Sub

Err_Handler:
MsgBox Err.Description, vbExclamation, "Error " & Err.Number
Resume Exit_Point
DoCmd.Hourglass False
End Sub
*************************************************
Can you tell me what I am doing wrong?
Thanks
Klaus
 
You need a DoCmd.Hourglass False at the end of your normal code as well as in
the error trap. If there is no error then your error trap code will not
execute and so not change back the cursor.

Amateur said:
Hi Dennis
thanks for helping me - I just have one problem because the hour glass
doesn't dissappear after finishing. I have the following code:
****************************************
Private Sub cmdTransfer_Click()

On Error GoTo Err_Handler

Dim strTargetDB As String
Dim strTargetTable As String
Dim strSQL As String

DoCmd.Hourglass True

strTargetDB = "C:\Documents and Settings\Klaus
Müller\Desktop\cps208web\transferdb.mdb"
strTargetTable = "webtotalbalancebie30p"

With CurrentDb

strSQL = _
"DELETE FROM [" & strTargetTable & "] " & _
"IN '" & _
strTargetDB & "';"

.Execute strSQL, dbFailOnError

strSQL = _
"INSERT INTO [" & strTargetTable & _
"](accountnumber, initialinvestment, guaranteedequity,
monthstartingbalance, optionpl, SumOfcontractvalue, optioncommission,
commission, managementfeebasic, Incentivefeetotal, electronicfee, vat,
adjustment, netliquidationbalance, paidoptionpremium, optionvalue,
SumOfopenpl, SumOfinitialmargin, SumOfmaintenancemargin, opentradebalance) IN
'" & _
strTargetDB & _
"' SELECT webtotalbalancebie30p.accountnumber,
webtotalbalancebie30p.initialinvestment,
webtotalbalancebie30p.guaranteedequity,
webtotalbalancebie30p.monthstartingbalance, webtotalbalancebie30p.optionpl,
webtotalbalancebie30p.SumOfcontractvalue,
webtotalbalancebie30p.optioncommission, webtotalbalancebie30p.commission,
webtotalbalancebie30p.managementfeebasic,
webtotalbalancebie30p.incentivefeetotal, webtotalbalancebie30p.electronicfee,
webtotalbalancebie30p.vat, webtotalbalancebie30p.adjustment,
webtotalbalancebie30p.netliquidationbalance,
webtotalbalancebie30p.paidoptionpremium, webtotalbalancebie30p.optionvalue,
webtotalbalancebie30p.SumOfopenpl, webtotalbalancebie30p.SumOfinitialmargin,
webtotalbalancebie30p.SumOfmaintenancemargin,
webtotalbalancebie30p.opentradebalance " & _
"FROM webtotalbalancebie30p;"


CurrentDb.Execute strSQL, dbFailOnError

End With
-------------------- the is a lot more and in the end I have
-------------------------
Exit_Point:
Exit Sub

Err_Handler:
MsgBox Err.Description, vbExclamation, "Error " & Err.Number
Resume Exit_Point
DoCmd.Hourglass False
End Sub
*************************************************
Can you tell me what I am doing wrong?
Thanks
Klaus

Dennis said:
If you are using a macro to execute your commands then place the line
Hourglass with the option of yes at the beginning and Hourglass with option
of No at the end.

If you are using VBA code then place
DoCmd.Hourglass True at the beginning of your routine and DoCmd.Hourglass
False at the end of the routine.

Be aware that if your code breaks with an error during your routines, your
cursor will remain as an hourglass unless you have an error trap to reset it.
 
Thaks again - its working
Klaus

Dennis said:
You need a DoCmd.Hourglass False at the end of your normal code as well as in
the error trap. If there is no error then your error trap code will not
execute and so not change back the cursor.

Amateur said:
Hi Dennis
thanks for helping me - I just have one problem because the hour glass
doesn't dissappear after finishing. I have the following code:
****************************************
Private Sub cmdTransfer_Click()

On Error GoTo Err_Handler

Dim strTargetDB As String
Dim strTargetTable As String
Dim strSQL As String

DoCmd.Hourglass True

strTargetDB = "C:\Documents and Settings\Klaus
Müller\Desktop\cps208web\transferdb.mdb"
strTargetTable = "webtotalbalancebie30p"

With CurrentDb

strSQL = _
"DELETE FROM [" & strTargetTable & "] " & _
"IN '" & _
strTargetDB & "';"

.Execute strSQL, dbFailOnError

strSQL = _
"INSERT INTO [" & strTargetTable & _
"](accountnumber, initialinvestment, guaranteedequity,
monthstartingbalance, optionpl, SumOfcontractvalue, optioncommission,
commission, managementfeebasic, Incentivefeetotal, electronicfee, vat,
adjustment, netliquidationbalance, paidoptionpremium, optionvalue,
SumOfopenpl, SumOfinitialmargin, SumOfmaintenancemargin, opentradebalance) IN
'" & _
strTargetDB & _
"' SELECT webtotalbalancebie30p.accountnumber,
webtotalbalancebie30p.initialinvestment,
webtotalbalancebie30p.guaranteedequity,
webtotalbalancebie30p.monthstartingbalance, webtotalbalancebie30p.optionpl,
webtotalbalancebie30p.SumOfcontractvalue,
webtotalbalancebie30p.optioncommission, webtotalbalancebie30p.commission,
webtotalbalancebie30p.managementfeebasic,
webtotalbalancebie30p.incentivefeetotal, webtotalbalancebie30p.electronicfee,
webtotalbalancebie30p.vat, webtotalbalancebie30p.adjustment,
webtotalbalancebie30p.netliquidationbalance,
webtotalbalancebie30p.paidoptionpremium, webtotalbalancebie30p.optionvalue,
webtotalbalancebie30p.SumOfopenpl, webtotalbalancebie30p.SumOfinitialmargin,
webtotalbalancebie30p.SumOfmaintenancemargin,
webtotalbalancebie30p.opentradebalance " & _
"FROM webtotalbalancebie30p;"


CurrentDb.Execute strSQL, dbFailOnError

End With
-------------------- the is a lot more and in the end I have
-------------------------
Exit_Point:
Exit Sub

Err_Handler:
MsgBox Err.Description, vbExclamation, "Error " & Err.Number
Resume Exit_Point
DoCmd.Hourglass False
End Sub
*************************************************
Can you tell me what I am doing wrong?
Thanks
Klaus

Dennis said:
If you are using a macro to execute your commands then place the line
Hourglass with the option of yes at the beginning and Hourglass with option
of No at the end.

If you are using VBA code then place
DoCmd.Hourglass True at the beginning of your routine and DoCmd.Hourglass
False at the end of the routine.

Be aware that if your code breaks with an error during your routines, your
cursor will remain as an hourglass unless you have an error trap to reset it.

:

Dear Sirs
I'm executing with a command button on a form many commands.
Is there a possibility to show, with help of a "egg-watch" (I don't now the
correct word for it - it's just a litural translation from German), to show
when the commands are finished?

Thanks for any help
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Transferring a DB 1
Butto command 1
Printing a report 2
Report as e-mail 1
Back-up DB's 2
Opening a Form 4
Setting a table field value to"0,00" after command button click 3
Report printing 3

Back
Top