A
Anja
Hi everyone,
I am running Access and am using VBA to make a custom app.
I have a tab control and one of the pages has a subform. I query the
currently selected record in the subform by overriding the 'On Current'
event as follows:
Private Sub Form_Current()
Dim rs As Recordset
Set rs = Me.Recordset
If Not rs.EOF Or Not rs.BOF Then
MsgBox rs![FormalName]
End If
End Sub
This works fine. Now, I wanted to requery the subform everytime the tab
control changs pages as the underlying records might have changed.
So, I did the following:
Private Sub TabCtl6_Change()
Me.SuppliersWithUnknownCategories_V_subform.Form.Requery
End Sub
However, this always ends up in the previous method with the error "No
current record.".
I tried Refresh, Recalc and other methods but they do not seem to
refresh the data.
Any ideas how I can query the subform data again properly?
Any help is greatly appreciated.
Thanks,
Anja
I am running Access and am using VBA to make a custom app.
I have a tab control and one of the pages has a subform. I query the
currently selected record in the subform by overriding the 'On Current'
event as follows:
Private Sub Form_Current()
Dim rs As Recordset
Set rs = Me.Recordset
If Not rs.EOF Or Not rs.BOF Then
MsgBox rs![FormalName]
End If
End Sub
This works fine. Now, I wanted to requery the subform everytime the tab
control changs pages as the underlying records might have changed.
So, I did the following:
Private Sub TabCtl6_Change()
Me.SuppliersWithUnknownCategories_V_subform.Form.Requery
End Sub
However, this always ends up in the previous method with the error "No
current record.".
I tried Refresh, Recalc and other methods but they do not seem to
refresh the data.
Any ideas how I can query the subform data again properly?
Any help is greatly appreciated.
Thanks,
Anja