L
(Lisa Hopkins),
Access 03
I have two forms, MAIN FORM and DUI FORM. They are connected via
relationships 1 to many
On the MAIN FORM I have a code connected to a field check box 1DUI
Private Sub Ctl1DUI_AfterUpdate()
If [1DUI] = True Then
Dim stDocName As String
Dim stCriteria As String
stDocName = "DUI FORM"
stLinkCriteria = "CASENUMBER=" & "'" & Me!CASENUMBER & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.CASENUMBER
End If
End Sub
This opens DUI FORM with the same record casenumber already incerted
on field
On the DUI FORM I have a cndButton to close this form
What I want to happen is when the DUI FORM closes, I want the setfocus
on the next field
on the MAIN FORM which is called PED
This is what I did
Private Sub close_form_in_DUI_FORM_Click()
On Error GoTo Err_close_form_in_DUI_FORM_Click
DoCmd.Close
Form![MAIN FORM].PED.SetFocus
Exit_close_form_in_DUI_FORM_Click:
Exit Sub
Err_close_form_in_DUI_FORM_Click:
MsgBox Err.Description
Resume Exit_close_form_in_DUI_FORM_Click
End Sub
I get this ERROR window:
The expression you entered refers to an object that is closed or
dosen't exist. OK
When I return to the code PED is highlighted and i don't understand
because there is a PED in the table and PED on the MAIN FORM
You need to know that i do not do this stuff for a living, I am
basicly fumbling around
and learning as I go
Patty
I have two forms, MAIN FORM and DUI FORM. They are connected via
relationships 1 to many
On the MAIN FORM I have a code connected to a field check box 1DUI
Private Sub Ctl1DUI_AfterUpdate()
If [1DUI] = True Then
Dim stDocName As String
Dim stCriteria As String
stDocName = "DUI FORM"
stLinkCriteria = "CASENUMBER=" & "'" & Me!CASENUMBER & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria, , , Me.CASENUMBER
End If
End Sub
This opens DUI FORM with the same record casenumber already incerted
on field
On the DUI FORM I have a cndButton to close this form
What I want to happen is when the DUI FORM closes, I want the setfocus
on the next field
on the MAIN FORM which is called PED
This is what I did
Private Sub close_form_in_DUI_FORM_Click()
On Error GoTo Err_close_form_in_DUI_FORM_Click
DoCmd.Close
Form![MAIN FORM].PED.SetFocus
Exit_close_form_in_DUI_FORM_Click:
Exit Sub
Err_close_form_in_DUI_FORM_Click:
MsgBox Err.Description
Resume Exit_close_form_in_DUI_FORM_Click
End Sub
I get this ERROR window:
The expression you entered refers to an object that is closed or
dosen't exist. OK
When I return to the code PED is highlighted and i don't understand
because there is a PED in the table and PED on the MAIN FORM
You need to know that i do not do this stuff for a living, I am
basicly fumbling around
and learning as I go
Patty