A
Andy
Hi All, (Access 2002, Windows XP Pro)
I have an Access form which opens another form whilst passing a key value in
the open args. The key value is used in the Form_Load event of the second
form to generate its recordsource. The form opened fine for a dozen or so
times but then stopped opening. All I saw was the hour glass momentarily and
nothing else. Now the whole database freezes and I have to close it with
task manager. The form calling code follows:
Private Sub lblSendEmail_Click()
On Error GoTo ErrorHandler
Dim lngCandidateID As Long
'lngCandidateID = Nz(Me![CandidateID])
lngCandidateID = Me.CandidateID
If lngCandidateID <> 0 Then
'DoCmd.OpenForm FormName:="frmCandidateEmail", View:=acNormal,
OpenArgs:=lngCandidateID
DoCmd.OpenForm "frmCandidateEmail", acNormal, , , , acDialog,
lngCandidateID
End If
exitSendEmail:
Exit Sub
ErrorHandler:
MsgBox Err.Description '
MsgBox Err.Number & ": " & Err.Description
Resume exitSendEmail
End Sub
And here is the Form_Load code from the form I want to open:
Private Sub Form_Load()
On Error GoTo ErrorHandler
'Me.RecordSource = "SELECT * FROM tblCandidates WHERE CandidateID = " &
Me.OpenArgs
'Me.Caption = " Email - Candidate"
exitForm_Load:
Exit Sub
ErrorHandler:
MsgBox Err.Description '
MsgBox Err.Number & ": " & Err.Description
Resume exitForm_Load
End Sub
I'm stumped. Any ideas at all about whats the cause of this behaviour?
Any ideas greatly appreciated.
Andy.
I have an Access form which opens another form whilst passing a key value in
the open args. The key value is used in the Form_Load event of the second
form to generate its recordsource. The form opened fine for a dozen or so
times but then stopped opening. All I saw was the hour glass momentarily and
nothing else. Now the whole database freezes and I have to close it with
task manager. The form calling code follows:
Private Sub lblSendEmail_Click()
On Error GoTo ErrorHandler
Dim lngCandidateID As Long
'lngCandidateID = Nz(Me![CandidateID])
lngCandidateID = Me.CandidateID
If lngCandidateID <> 0 Then
'DoCmd.OpenForm FormName:="frmCandidateEmail", View:=acNormal,
OpenArgs:=lngCandidateID
DoCmd.OpenForm "frmCandidateEmail", acNormal, , , , acDialog,
lngCandidateID
End If
exitSendEmail:
Exit Sub
ErrorHandler:
MsgBox Err.Description '
MsgBox Err.Number & ": " & Err.Description
Resume exitSendEmail
End Sub
And here is the Form_Load code from the form I want to open:
Private Sub Form_Load()
On Error GoTo ErrorHandler
'Me.RecordSource = "SELECT * FROM tblCandidates WHERE CandidateID = " &
Me.OpenArgs
'Me.Caption = " Email - Candidate"
exitForm_Load:
Exit Sub
ErrorHandler:
MsgBox Err.Description '
MsgBox Err.Number & ": " & Err.Description
Resume exitForm_Load
End Sub
I'm stumped. Any ideas at all about whats the cause of this behaviour?
Any ideas greatly appreciated.
Andy.