megatronixs
Registered User.
- Local time
 - Today, 15:29
 
- Joined
 - Aug 17, 2012
 
- Messages
 - 719
 
Hi,
 
I have a problem when I close a form to stop it from closing if a date is not filled in.
If the field "Case_Status" is filled in with "response received" and the date field "response_received_date" is blank, it shows a message and fils in the text box with red background.
It simply fails to keep the form from closing till the date is filled in. I have no clue where I got wrong at. Please see the code I have so far:
 
	
	
	
		
 
Greetings.
 I have a problem when I close a form to stop it from closing if a date is not filled in.
If the field "Case_Status" is filled in with "response received" and the date field "response_received_date" is blank, it shows a message and fils in the text box with red background.
It simply fails to keep the form from closing till the date is filled in. I have no clue where I got wrong at. Please see the code I have so far:
		Code:
	
	
	Private Sub CloseForm_Click()
 
    If Me.Case_Status = "response received" And IsNull(Me.response_received__date_) Then
    Me.response_received__date.BackColor = RGB(255, 0, 0)
    MsgBox ("Please fill in manatory fields!!!")
    DoCmd.CancelEvent
    Else
    DoCmd.Close
    End If
End Sub
	Greetings.