I have a form with a subform. The subform holds details of products ordered, the main form details of the order. I want to make sure that my users will complete all of the fields on the main form before they complete the product details, hence ensuring that no part orders slip hrough the net. The problem is that my code does not seem to work! This runs from the AfterUpdate event of the main form:
Now the bit looking at the date works fine, it's just that the est doesn't! Any ideas!!!???? I have tried replacing the .value = null bit with is null and that won't work either!
Thanks in advance!
Robbo ;-)
Code:
Private Sub Form_AfterUpdate()
If [Forms]![frmContactInformation]![frmOrders1subform].Form![Date] > Int(Now()) Then
MsgBox "Order dates can not be set for the future." & vbCrLf & vbCrLf & "Please enter a valid date.", vbOKOnly + vbExclamation, "Invalid Order Date"
[Forms]![frmContactInformation]![frmOrders1subform].Form![Date].Value = Null
DoCmd.OpenForm "frmCalendar3"
End If
If [Forms]![frmContactInformation]![frmOrders1subform].Form![PlacedBy].Value = Null Then
MsgBox "you have not entered a name in the 'placed by' field." & vbCrLf & vbCrLf & "Please do so now.", vbOKOnly + vbExclamation, "Incomplete Order Details"
[Forms]![frmContactInformation]![frmOrders1subform].Form![PlacedBy].SetFocus
End If
If [Forms]![frmContactInformation]![frmOrders1subform].Form![CboEmployees].Value = Null Then
MsgBox "you have not selected an employee to assign the order to." & vbCrLf & vbCrLf & "Please do so now.", vbOKOnly + vbExclamation, "Incomplete Order Details"
[Forms]![frmContactInformation]![frmOrders1subform].Form![CboEmployees].Dropdown
End If
If [Forms]![frmContactInformation]![frmOrders1subform].Form![Type].Value = Null Then
MsgBox "you have not selected an order type." & vbCrLf & vbCrLf & "Please do so now.", vbOKOnly + vbExclamation, "Incomplete Order Details"
[Forms]![frmContactInformation]![frmOrders1subform].Form![Type].Dropdown
End If
End Sub
Now the bit looking at the date works fine, it's just that the est doesn't! Any ideas!!!???? I have tried replacing the .value = null bit with is null and that won't work either!
Thanks in advance!
Robbo ;-)