Hi All,
I have a main form called frm_AddNewShift and a related subform called SubRecords. I want to be able to verify that the four controls on the main form have been populated before i allow access to the subform. I added the following code to the GotFocus event of the first control on the subform which is called SampleTime. I'm getting a syntax error but i don't know how to correct it ?. Is there a better way of doing this ?
Thanks
I have a main form called frm_AddNewShift and a related subform called SubRecords. I want to be able to verify that the four controls on the main form have been populated before i allow access to the subform. I added the following code to the GotFocus event of the first control on the subform which is called SampleTime. I'm getting a syntax error but i don't know how to correct it ?. Is there a better way of doing this ?
Thanks
Code:
Private Sub SampleTime_GotFocus()
If IsNull [Forms]![frm_AddNewShift]![Block]
MsgBox "You Must Enter a Block", vbCritical, "You forgot something..."
Cancel = True
Me.Parent.Block.SetFocus
Exit Sub
End Sub