R
Robert Painter
Good evening
I have a project almost finished and am making it error proof hopefully.
I have an Employee form where details are inputted for personal details and
then I have another form for inputting further data. I have a cmdAddSkills
button to go from frmEmployees to frmAddSkills. What happens is with the
following code:
Private Sub cmdAddSkill_Click()
On Error GoTo Err_cmdAddSkill_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAddSkills"
stLinkCriteria = "[CustomisedID]=" & "'" & Me![CustomisedID] & "'"
DoCmd.Close acForm, "frmEmployees"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdAddSkill_Click:
Exit Sub
Err_cmdAddSkill_Click:
MsgBox Err.Description
Resume Exit_cmdAddSkill_Click
End Sub
What i need is to stop this happening if the record in frmEmployees remains
blank, based on CustomisedID. At present if the frmEmployees has been filled
in then the frmAddSkills record is there (by closing frmEmployees first),
but if the record in frmEmployees is an empty/new record then frmAddSkills
is just a clear page and the db bloats with empty records.
How can I do this please ??
Robert
I have a project almost finished and am making it error proof hopefully.
I have an Employee form where details are inputted for personal details and
then I have another form for inputting further data. I have a cmdAddSkills
button to go from frmEmployees to frmAddSkills. What happens is with the
following code:
Private Sub cmdAddSkill_Click()
On Error GoTo Err_cmdAddSkill_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAddSkills"
stLinkCriteria = "[CustomisedID]=" & "'" & Me![CustomisedID] & "'"
DoCmd.Close acForm, "frmEmployees"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_cmdAddSkill_Click:
Exit Sub
Err_cmdAddSkill_Click:
MsgBox Err.Description
Resume Exit_cmdAddSkill_Click
End Sub
What i need is to stop this happening if the record in frmEmployees remains
blank, based on CustomisedID. At present if the frmEmployees has been filled
in then the frmAddSkills record is there (by closing frmEmployees first),
but if the record in frmEmployees is an empty/new record then frmAddSkills
is just a clear page and the db bloats with empty records.
How can I do this please ??
Robert