Z
Zare
Hi all!
I have a problem with subform in Access97.
I have a form and a subform in my application. Subform is attached to
the main form, and they are not intentionally related. They show
records from same table.
When I navigate through records using navigation buttons on the main
form, for each record on the main form same record is marked in
subform. For that task I use following code:
--------------------------------------------------------
Sub subformgrid()
Dim Rs As Recordset
With Forms![Form_Authors]![Form_Authors_subform].Form
Set Rs = .RecordsetClone
If Me.CurrentRecord <= rekordnumber Then
Rs.FindFirst "[AuthorID]=" & Me![AuthorID]
.Bookmark = Rs.Bookmark
End If
End With
Set Rs = Nothing
End Sub
-------------------------------------------------------
I call that procedure in: Load, AfterUpdate, Current events of the
main form.
-------------------------------------------------------
Situation 1:
I use mouse to navigate through records on main form. Everything seems
OK.
-------------------------------------------------------
Situation 2:
I use tab key to navigate. At first click it fires an error:
Run-time error "2455":
You entered an expression that has an invalid reference to the
property Form/Report.
The property may not exist or may not apply to the object you specify.
Access97 is halted and following is highlighted:
With Forms![Form_Authors]![Form_Authors_subform].Form
---------------------------------------------------------
Situation 3:
Before I use tab key to navigate, I DO NOT call that procedure from
Form_Current event, or delete Current event. Everything seems OK!
How can I solve this problem? It seems to me that Current event of the
form is problematic?!
Thanks for any help in advance!
Zare
I have a problem with subform in Access97.
I have a form and a subform in my application. Subform is attached to
the main form, and they are not intentionally related. They show
records from same table.
When I navigate through records using navigation buttons on the main
form, for each record on the main form same record is marked in
subform. For that task I use following code:
--------------------------------------------------------
Sub subformgrid()
Dim Rs As Recordset
With Forms![Form_Authors]![Form_Authors_subform].Form
Set Rs = .RecordsetClone
If Me.CurrentRecord <= rekordnumber Then
Rs.FindFirst "[AuthorID]=" & Me![AuthorID]
.Bookmark = Rs.Bookmark
End If
End With
Set Rs = Nothing
End Sub
-------------------------------------------------------
I call that procedure in: Load, AfterUpdate, Current events of the
main form.
-------------------------------------------------------
Situation 1:
I use mouse to navigate through records on main form. Everything seems
OK.
-------------------------------------------------------
Situation 2:
I use tab key to navigate. At first click it fires an error:
Run-time error "2455":
You entered an expression that has an invalid reference to the
property Form/Report.
The property may not exist or may not apply to the object you specify.
Access97 is halted and following is highlighted:
With Forms![Form_Authors]![Form_Authors_subform].Form
---------------------------------------------------------
Situation 3:
Before I use tab key to navigate, I DO NOT call that procedure from
Form_Current event, or delete Current event. Everything seems OK!
How can I solve this problem? It seems to me that Current event of the
form is problematic?!
Thanks for any help in advance!
Zare