ASAP: How do u set the cmdOK_Click event to have more than one event procedure 
Author Message
 ASAP: How do u set the cmdOK_Click event to have more than one event procedure

ex:
Private Sub cmdOK_Click()
    If optSaving.Value = True Or optChequing.Value = True Then
        txtMessage = "Please select your transaction." & _
            "Press OK when finish."
            fraTransaction.Visible = True
    End If

    If optDeposit.Value = True Or optWithdraw.Value = True Or _
        optTransfer.Value = True Or optBillPayment.Value = True Then
        lblInput.Visible = True
        txtInput.Visible = True
    End If
        'I want to give control to the txtInput after the OK command button
is click
        '2 times
        'txtInput.SetFocus
End Sub



Fri, 14 Dec 2001 03:00:00 GMT  
 ASAP: How do u set the cmdOK_Click event to have more than one event procedure
You could declare a static variable and do something like this

Private Sub cmdOK_Click()
    STATIC CTR AS INTERGER
    CTR = CTR + 1
    IF CTR =1 THEN
        If optSaving.Value = True Or optChequing.Value = True Then
            txtMessage = "Please select your transaction." & _
                "Press OK when finish."
                fraTransaction.Visible = True
        End If

        If optDeposit.Value = True Or optWithdraw.Value = True Or _
            optTransfer.Value = True Or optBillPayment.Value = True Then
            lblInput.Visible = True
            txtInput.Visible = True
        End If
    ELSE
            'I want to give control to the txtInput after the OK command
button
    is click
            '2 times
            txtInput.SetFocus
            CTR = 0  'THIS WILL RESET IT FOR THE NEXT TIME
    END IF
End Sub

If you don't want to use a static variable you could change the Caption on
your button after to click it once. From OK to Finished and check the
caption on the button

Hope this helps
Mike

Quote:

>ex:
>Private Sub cmdOK_Click()
>    If optSaving.Value = True Or optChequing.Value = True Then
>        txtMessage = "Please select your transaction." & _
>            "Press OK when finish."
>            fraTransaction.Visible = True
>    End If

>    If optDeposit.Value = True Or optWithdraw.Value = True Or _
>        optTransfer.Value = True Or optBillPayment.Value = True Then
>        lblInput.Visible = True
>        txtInput.Visible = True
>    End If
>        'I want to give control to the txtInput after the OK command button
>is click
>        '2 times
>        'txtInput.SetFocus
>End Sub



Sat, 15 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Dynamic Labels with Events - having probs with events part

2. Common Dialog and Timer Events/MCI Done Event

3. Handling multiple mouse events in one procedure

4. One procedure for two events

5. Self-referencing a control's name within one of it's event procedures

6. handling multiple events with one event handler

7. Can one event interupt another event?

8. How to Retrieve Events For One Day From An Event Log on Windows 2000/NT

9. how do you make one event for multiple events

10. Set bmp visible from event handler procedure??

11. Procedure with 2 record sets one select, one update

12. A Newbie having trouble passing variables from one sup-procedure to another

 

 
Powered by phpBB® Forum Software