R
Richard Mogy
From: "Richard Mogy" <[email protected]>
Subject: Re: User Form maneuvering
Date: Thursday, May 06, 2004 6:59 AM
Thanks to those who replied. I apologize for not including the code. I
have used the setfocus command, here's basically what the screen looks like
Enter Start Date:
Enter End Date:
Enter Office:
Enter Start Account:
Enter End Account:
Process End
Using these after updates in the "End Date" and "End Account", if the error
is in the end date, focus goes to "Start Account". If the error is in the
End Account, focus goes to the "END" command button.
Here's the code
Private Sub TxtDateTo_afterupdate()
date1 = Format(TxtFromDate.text, "mm/dd/yyyy")
date2 = Format(TxtDateTo.text, "mm/dd/yyyy")
If date2 < date1 Then
Me.TxtFromDate.SetFocus
TxtDateTo.text = ""
TxtFromDate.text = ""
TxtMessage.text = "End Date must be greater than or equal start date"
End If
End Sub
Private Sub txtEndAccount_afterupdate()
acct1 = txtStartAccount.text
acct2 = txtEndAccount.text
If acct2 < acct1 Or Len(acct2) < 5 Or Len(acct1) < 5 Then
Me.txtStartAccount.SetFocus
txtStartAccount.text = ""
txtEndAccount.text = ""
TxtMessage.text = "End Account must be greater than or equal start
Account"
End If
End Sub
Subject: Re: User Form maneuvering
Date: Thursday, May 06, 2004 6:59 AM
Thanks to those who replied. I apologize for not including the code. I
have used the setfocus command, here's basically what the screen looks like
Enter Start Date:
Enter End Date:
Enter Office:
Enter Start Account:
Enter End Account:
Process End
Using these after updates in the "End Date" and "End Account", if the error
is in the end date, focus goes to "Start Account". If the error is in the
End Account, focus goes to the "END" command button.
Here's the code
Private Sub TxtDateTo_afterupdate()
date1 = Format(TxtFromDate.text, "mm/dd/yyyy")
date2 = Format(TxtDateTo.text, "mm/dd/yyyy")
If date2 < date1 Then
Me.TxtFromDate.SetFocus
TxtDateTo.text = ""
TxtFromDate.text = ""
TxtMessage.text = "End Date must be greater than or equal start date"
End If
End Sub
Private Sub txtEndAccount_afterupdate()
acct1 = txtStartAccount.text
acct2 = txtEndAccount.text
If acct2 < acct1 Or Len(acct2) < 5 Or Len(acct1) < 5 Then
Me.txtStartAccount.SetFocus
txtStartAccount.text = ""
txtEndAccount.text = ""
TxtMessage.text = "End Account must be greater than or equal start
Account"
End If
End Sub