M
Mus' via AccessMonster.com
Hi
I can't seem to fathom this one.
I have a form (frmClients) and in a tabbed page their is a subform
(fsubDetails) 1 client can have many details.
fsubDetails shows, amongst other things, the current value and date of
valuation. To update these values the user open a popfrm and enter the latest
valuation and date (added to tbl of previous valuations). On closing (using
OnClose event) the popfrm I requery the subform to update the valuation
details, however, it always go back to the first record on fsubDetails.
How can I do so, whilst 'retaining' focus on the current record?
I have tried capturing the fsub PK in a variable, but can't seem to setfocus
on to the subfrm and findfirst ID that matches.I have tried suggestions from
previous threads but have yet to achieve the results I desire.
Often when trying to setfocus to the subfrm it says that it cannot find the
'field' of that name(?!)
Code so far (in popfrmValues):
Private Sub Form_Close()
On Error GoTo Form_Close_Err
Dim lngID As Long
lngID = [Forms]![frmClients]![qryDetails subform].[Form]!DetailID.Value
'Debug.Print lngID ' Just to check
[Forms]![frmClients]![qryDetails subform].[Form].Requery
' To update value details
'Need something else here?
Me.Recordset.FindFirst "DetailID=" & lngID
lngID = Empty
Form_Close_Exit:
Exit Sub
Form_Close_Err:
MsgBox Error$
Resume Form_Close_Exit
P.S. Using Acc2000 format.
I can't seem to fathom this one.
I have a form (frmClients) and in a tabbed page their is a subform
(fsubDetails) 1 client can have many details.
fsubDetails shows, amongst other things, the current value and date of
valuation. To update these values the user open a popfrm and enter the latest
valuation and date (added to tbl of previous valuations). On closing (using
OnClose event) the popfrm I requery the subform to update the valuation
details, however, it always go back to the first record on fsubDetails.
How can I do so, whilst 'retaining' focus on the current record?
I have tried capturing the fsub PK in a variable, but can't seem to setfocus
on to the subfrm and findfirst ID that matches.I have tried suggestions from
previous threads but have yet to achieve the results I desire.
Often when trying to setfocus to the subfrm it says that it cannot find the
'field' of that name(?!)
Code so far (in popfrmValues):
Private Sub Form_Close()
On Error GoTo Form_Close_Err
Dim lngID As Long
lngID = [Forms]![frmClients]![qryDetails subform].[Form]!DetailID.Value
'Debug.Print lngID ' Just to check
[Forms]![frmClients]![qryDetails subform].[Form].Requery
' To update value details
'Need something else here?
Me.Recordset.FindFirst "DetailID=" & lngID
lngID = Empty
Form_Close_Exit:
Exit Sub
Form_Close_Err:
MsgBox Error$
Resume Form_Close_Exit
P.S. Using Acc2000 format.