G
Guest
I have an application which uses a form qer TeeTimesForComps to allow users
to reserve tee times.
when a record is deleted by a user the following code runs on the before
update event, and opens a second form frmtblPWLOG which determines if the
user is authorised to delete the record.
Private Sub Player_1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Dim Oldvalue As String
If IsNull(Player_1.Oldvalue) Then
Player_1.Locked = False
Else
If Not IsNull(Player_1.Oldvalue) Then
Oldvalue = (Player_1.Oldvalue)
DoCmd.OpenForm "frmtblPWLOG", acNormal, "", "", acFormEdit, acWindowNormal, ""
Forms![frmtblPWLOG]![TeeTime] = Forms![qerTeeTimesForComps]![Tee Time]
Forms![frmtblPWLOG]![Player] = Oldvalue
Beep
Cancel = True
Player_1.Undo
Else
End If
End If
End Sub
This form works perfectly.
I have now used this form as a subform in another form for displaying
competition details.
When I now try to delete a record it opens form frmtblPWLOG, but hangs up at
the next line
Forms![frmtblPWLOG]![TeeTime] = Forms![qerTeeTimesForComps]![Tee Time]
with theerror
Cannot find the form frmTeeTimesFor Comps referred to in your expression.
Can anyone see any reason why it does not work as it does when used as a
stand alone form.
Thanks for any help
to reserve tee times.
when a record is deleted by a user the following code runs on the before
update event, and opens a second form frmtblPWLOG which determines if the
user is authorised to delete the record.
Private Sub Player_1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Dim Oldvalue As String
If IsNull(Player_1.Oldvalue) Then
Player_1.Locked = False
Else
If Not IsNull(Player_1.Oldvalue) Then
Oldvalue = (Player_1.Oldvalue)
DoCmd.OpenForm "frmtblPWLOG", acNormal, "", "", acFormEdit, acWindowNormal, ""
Forms![frmtblPWLOG]![TeeTime] = Forms![qerTeeTimesForComps]![Tee Time]
Forms![frmtblPWLOG]![Player] = Oldvalue
Beep
Cancel = True
Player_1.Undo
Else
End If
End If
End Sub
This form works perfectly.
I have now used this form as a subform in another form for displaying
competition details.
When I now try to delete a record it opens form frmtblPWLOG, but hangs up at
the next line
Forms![frmtblPWLOG]![TeeTime] = Forms![qerTeeTimesForComps]![Tee Time]
with theerror
Cannot find the form frmTeeTimesFor Comps referred to in your expression.
Can anyone see any reason why it does not work as it does when used as a
stand alone form.
Thanks for any help