Link to home
Start Free TrialLog in
Avatar of wlwebb
wlwebbFlag for United States of America

asked on

Access - Tabbed Forms. - Pause/Break/Wait to wait for a response to answer on another tab........

Hello all

I have a tabbed form which has about 8 tabs.  On One of those forms, if all of the amounts are zero, I make visible a tab where the user "Verifies" that all the amounts in fact should be zero.  

Once the answer to that "Verify" is true OR if all of the amounts aren't zero, then that first form opens a 3rd tabbed subform to a specific set of records......

Now then, what I want it to do is pause for that answer on the "Verify" tabbed form.

My current code make's that "Verify" form visible but is immediately going thru the rest of the code which kicks me to the 3rd form immediately.

Is there any type of code that will allow a "Non Timer" wait????

Here is the complete code.
Private Sub cmdSaveCtlTotals_Click()
    
If Me.txtCtlProofTotal = 0 Then
    If (Me.txtProofAbsoluteZeros) = 0 Then
        Parent.Page3.Visible = True
        Parent.Page3.SetFocus
    
    End If
        
    curCtlTtlAmtIn = Me.txtCtlAmtIn
    curCtlTtlAmtOut = Me.txtCtlAmtOut
    curCtlTtlNetAmt = Me.txtCtlNetAmt
    curCtlTtlAmtVal = Me.txtCtlAmtVal
    
    Call UpdateTotals
    
    [Forms]![frm_DataReporting]![txtTtlAmtIn] = curCtlTtlAmtIn
    [Forms]![frm_DataReporting]![txtTtlAmtOut] = curCtlTtlAmtOut
    [Forms]![frm_DataReporting]![txtTtlNetAmt] = curCtlTtlNetAmt
    [Forms]![frm_DataReporting]![txtTtlAmtVal] = curCtlTtlAmtVal
    
    Parent.Page4.SetFocus
    [Forms]![frm_DataReporting]![ShiftReportingLVL]![AmtIn].SetFocus
Else
    MsgBox "The Control Totals you have entered are not correct.  Please review your input of each Total Amount.", vbOKOnly
        
End If

End Sub

Private Sub UpdateTotals()

Dim v As Integer, CurTtlAmtIn As Currency, CurTtlAmtOut As Currency, CurTtlNetAmt As Currency, CurTtlAmtVal As Currency

CurTtlAmtIn = curCtlTtlAmtIn
CurTtlAmtOut = curCtlTtlAmtOut
CurTtlNetAmt = curCtlTtlNetAmt
CurTtlAmtVal = curCtlTtlAmtVal

v = Val(Forms![frm_DataReporting]![WVLVLControlTotals].Form![txtNewShiftPrtgLVLCtlID])

CurrentDb.Execute "UPDATE ShiftReportingLVLCtl SET TtlAmtIn=" & CurTtlAmtIn & ", " & "TtlAmtOut=" & CurTtlAmtOut & ", " & "TtlNetAmt=" & CurTtlNetAmt & ", " & "TtlAmtVal=" & CurTtlAmtVal _
    & " WHERE ShiftRptgLVLCtlID=" & v, dbFailOnError
    
                                              
End Sub

**************** This is the code from that "Verify" Form
Private Sub cmdCancel_Click()
    
    Forms![frm_DataReporting]![WVLVLControlTotals].Form![txtCtlAmtIn].SetFocus
    Forms![frm_DataReporting]![WVLVLControlTotals].Form![txtCtlAmtIn].SelStart = 0
    Forms![frm_DataReporting]![WVLVLControlTotals].Form![txtCtlAmtIn].SelLength = Len(Forms![frm_DataReporting]![WVLVLControlTotals].Form![txtCtlAmtIn])
    Parent.Page2.SetFocus
    Parent.Page3.Visible = False
    
    Cancel = True
    
    
End Sub

Private Sub cmdVerifyAllZeros_Click()
    
If Me.ckBoxVerifyZeros = True Then
    Forms![frm_DataReporting]![WVLVLControlTotals].Form![txtVerificationYN] = "True"
    Forms![frm_DataReporting]![WVLVLControlTotals].Form![txtVerificationDate] = Now()
    Parent.Page4.SetFocus
    Parent.Page3.Visible = False
Else
    MsgBox ("You must check the box to verify that all the amounts on the Control Totals pages were intended to be zero Before clicking the ""Verify All Amounts Were Zero"" Button"), vbOKOnly, "Verify all amounts Zero Checkbox NOT Checked!"
End If


End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
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 wlwebb

ASKER

Not the answer I wanted......but I was afraid you'd say that....  Thanks!