Link to home
Start Free TrialLog in
Avatar of Joy Gomez
Joy Gomez

asked on

Get currentrecord of subform

I am using MS Access

1. I have a main form (MainForm).  
2. I have a sub form (SubForm).  
3. From the SubForm I open another form Form2.  
4. I would like to display the currentrecord in Form2 in a textbox so I can use it to GoToRecord in the SubForm.
ASKER CERTIFIED SOLUTION
Avatar of Fabrice Lambert
Fabrice Lambert
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Joy Gomez
Joy Gomez

ASKER

Dim sf As Access.Form
        Set sf = Forms![F_Maint_Check_Main]![F_Maint_Check_Vol_SoftAR_EC_New].Form
       
       
        Dim value As Integer
        value = sf.CurrentRecord.value


Hi Fabrice,

I am getting an invalid qualifier error for "CurrentRecord".
okay i got it to work... this was a good way to have done this... never knew... thanks much.
But now how do I return back to the form that i just open on which i had this code?  I am trying to close that form, and it does not.