sanders720
Programmer
I never knew it could be so much trouble to write an if then argument. Below are two versionns of a program. The first works, and the second (with some additions) does not.
Private Sub chkItem_Click()
Dim f As Boolean ' Flag - True/False checkbox
Dim d As Date ' Date - Date field
Dim ans As String
f = Me.MetroProcessFlag.Value
d = Me.MetroProcessDate.Value
If = Null Then
Me.MetroProcessDate.Value = Date
end if
End Sub
I have added a feature to the second listing to also check for a value in the date field (textbox). If it exists, there is no need to add it. The code just never happens!
Private Sub chkItem_Click()
Dim f As Boolean ' Flag - True/False checkbox
Dim d As Date ' Date - Date field
Dim ans As String
f = Me.MetroProcessFlag.Value
d = Me.MetroProcessDate.Value
If f = True And d <> Null Then
ans = MsgBox("The Selected Item has already been processed, would you like to run again?", vbYesNo)
If ans = vbYes Then
Me.MetroProcessDate.Value = Date
Else
Me.MetroProcessFlag = False
End If
End If
If f = True And d = Null Then
Me.MetroProcessDate.Value = Date
End If
End Sub
Thanks in advance for the help!
Private Sub chkItem_Click()
Dim f As Boolean ' Flag - True/False checkbox
Dim d As Date ' Date - Date field
Dim ans As String
f = Me.MetroProcessFlag.Value
d = Me.MetroProcessDate.Value
If = Null Then
Me.MetroProcessDate.Value = Date
end if
End Sub
I have added a feature to the second listing to also check for a value in the date field (textbox). If it exists, there is no need to add it. The code just never happens!
Private Sub chkItem_Click()
Dim f As Boolean ' Flag - True/False checkbox
Dim d As Date ' Date - Date field
Dim ans As String
f = Me.MetroProcessFlag.Value
d = Me.MetroProcessDate.Value
If f = True And d <> Null Then
ans = MsgBox("The Selected Item has already been processed, would you like to run again?", vbYesNo)
If ans = vbYes Then
Me.MetroProcessDate.Value = Date
Else
Me.MetroProcessFlag = False
End If
End If
If f = True And d = Null Then
Me.MetroProcessDate.Value = Date
End If
End Sub
Thanks in advance for the help!