S
Sue Wilkes
Hi All, I have on dirty behind my bound text boxes the following code.
Private Sub RegisterNumber_Dirty(Cancel As Integer)
'Enable SaveAddNewRec1 only if ALL required textboxes are dirty
If Me.AddNewRecIN.Enabled = True And Len(Me.DateReceived & vbNullString)
= 0 Then
ElseIf Me.AddNewRecOUT.Enabled = True And Len(Me.DateSent &
vbNullString) = 0 Then
ElseIf IsNull(Me.DeptCode) Then
ElseIf IsNull(Me.Designation) Then
ElseIf Me.AddNewRecIN.Enabled = True And Len(Me.ReceivedFrom &
vbNullString) = 0 Then
ElseIf Me.AddNewRecOUT.Enabled = True And Len(Me.SentTo &
vbNullString) = 0 Then
ElseIf IsNull(Me.CompanyNames) Then
ElseIf IsNull(Me.Subject) Then
ElseIf IsNull(Me.Hyperlink1) Then
Me.SaveAddNewRec1.Enabled = True
Me.SaveAddNewRec1.Visible = True
Me.SaveConfirm.Visible = True
This only enables the command button if all the required fields are complete
BUT only if I enter them in the tab order routine, if I deviate from this an
enter the data randomly then the command button does not appear. Could
someone please tell me where I'm going wrong. Many thanks Sue
Private Sub RegisterNumber_Dirty(Cancel As Integer)
'Enable SaveAddNewRec1 only if ALL required textboxes are dirty
If Me.AddNewRecIN.Enabled = True And Len(Me.DateReceived & vbNullString)
= 0 Then
ElseIf Me.AddNewRecOUT.Enabled = True And Len(Me.DateSent &
vbNullString) = 0 Then
ElseIf IsNull(Me.DeptCode) Then
ElseIf IsNull(Me.Designation) Then
ElseIf Me.AddNewRecIN.Enabled = True And Len(Me.ReceivedFrom &
vbNullString) = 0 Then
ElseIf Me.AddNewRecOUT.Enabled = True And Len(Me.SentTo &
vbNullString) = 0 Then
ElseIf IsNull(Me.CompanyNames) Then
ElseIf IsNull(Me.Subject) Then
ElseIf IsNull(Me.Hyperlink1) Then
Me.SaveAddNewRec1.Enabled = True
Me.SaveAddNewRec1.Visible = True
Me.SaveConfirm.Visible = True
This only enables the command button if all the required fields are complete
BUT only if I enter them in the tab order routine, if I deviate from this an
enter the data randomly then the command button does not appear. Could
someone please tell me where I'm going wrong. Many thanks Sue