|
-
Dec 7th, 1999, 08:58 AM
#2
Addicted Member
Hi Emidio,
Put a TextBox object, name it as Text1 also a CommandButton object,name it as Command1
-------------------------------
Dim blnExec(2, 2) As Boolean
Option Explicit
Private Sub Switch(code As String, a As Integer, b As Integer)
Select Case code
Case "LostFocus"
blnExec(1, 1) = IIf(a = 1, True, False) 'text1
blnExec(2, 1) = IIf(b = 1, True, False) 'command1
Case "Click"
blnExec(1, 2) = IIf(a = 1, True, False) 'text1
blnExec(2, 2) = IIf(b = 1, True, False) 'command1
End Select
End Sub
Private Sub Command1_LostFocus()
' if command1_lostfocus then
' disable all lost focus events
If (blnExec(2, 1)) Then
MsgBox ("Command1 lost focus")
Call Switch("LostFocus", 0, 0)
End If
End Sub
Private Sub Form_Load()
Call Switch("LostFocus", 1, 1)
End Sub
Private Sub Text1_LostFocus()
' if text1_lostfocus then
' disable command1_lostfocus event
' enable text1_lostfocus event
If (blnExec(1, 1)) Then
MsgBox ("Text1 lost focus")
Call Switch("LostFocus", 1, 0)
End If
End Sub
'-- if command1 receives lost focus before text1, then
' it will prompt "Command1 lost focus" after that
' the lost focus flags (for both) will be set to false
'-- if text1 receives lost focus before command1, then
' it will prompt "Text1 lost focus" after that
' the lost focus flag for command1 will be set to false and
' the lost focus flag for text1 will be set to true and
--------------------
Those above is just a concept, you can write
it in a better way.
Does it help ?
Regards
Keiko
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|