R
Rick
OK, I have a big problem and seek the wisdom of the mighty
Microsoft Newsgroup. I have a form for adding new
individuals when they are hired into the company. I have
code forcing individuals to fill in the required fields
but if they don't enter data in the required field, focus
is set to that field but it seems to create duplicate
records, two of the same individual. How can I set it
where it deletes the individual record or keep from
creating a duplicate record for that individual. The
caveat is, there can be several people with the same last
name so I can't restrict duplicates to the last name. Any
suggestions?
Here is my code:
ElseIf (IsNull([subfrmIntro]![DateofEmployment])) = True
Then
iResponse = MsgBox("You must enter the report no later
than date for this individual.", vbOKCancel, "Report No
Later Than Date is Blank")
Forms![subfrmIntro]![DateofEmployment].SetFocus
Select Case iResponse
Case vbOK
[subfrmIntro]![DateofEmployment].SetFocus
Case vbCancel
DoCmd.Close
End Select
Microsoft Newsgroup. I have a form for adding new
individuals when they are hired into the company. I have
code forcing individuals to fill in the required fields
but if they don't enter data in the required field, focus
is set to that field but it seems to create duplicate
records, two of the same individual. How can I set it
where it deletes the individual record or keep from
creating a duplicate record for that individual. The
caveat is, there can be several people with the same last
name so I can't restrict duplicates to the last name. Any
suggestions?
Here is my code:
ElseIf (IsNull([subfrmIntro]![DateofEmployment])) = True
Then
iResponse = MsgBox("You must enter the report no later
than date for this individual.", vbOKCancel, "Report No
Later Than Date is Blank")
Forms![subfrmIntro]![DateofEmployment].SetFocus
Select Case iResponse
Case vbOK
[subfrmIntro]![DateofEmployment].SetFocus
Case vbCancel
DoCmd.Close
End Select