Controlling records of subform from main form

capsula4

Registered User.
Local time
Today, 04:41
Joined
Jan 3, 2008
Messages
122
Hi!

I have a main form: MAIN_FORM

and a subform on MAIN_FORM called SUB_FORM

I have a button on MAIN_FORM to browse records but I want to make effect on the SUB_FORM

I tried this:

DoCmd.GoToRecord acDataForm, SUB_FORM, acFirst

I also thought of using a header for the subform, but since I want the subform to be a spreadsheet instead of continous forms, I thought of using mainform with subform.

And I also want to make a sub on the main that have effects on the SUB_FORM (like a massive paste), how do I refer to a field of a subform? :D
 
the subform will have a name such as mydetails on the main form

just mydetails!myfield will get you there (might be dot not bang)

------
in the same way, from the subform

parent!mymainfield will work also (again might be dot)
 
the subform will have a name such as mydetails on the main form

just mydetails!myfield will get you there (might be dot not bang)

------
in the same way, from the subform

parent!mymainfield will work also (again might be dot)

Thanks! that worked for handling different fields which is part of what I was looking for!!!

Does anyone know now how to make Cmd functions work on subforms? I kinda want to make a massive paste on a field of a subform, so what I'm doing is kinda like this:

Code:
DoCmd.GotoRecord,, acLast
LastRec = CurrentRecord
DoCmd.GotoRecord,, acFirst
Do Until (CurrentRecord=LastRec)
[Details].Form![FieldToBePasted]=Me![FieldWithInfo]
DoCmd.GoToRecord , , acNext
Loop

Tho, all the DoCmd should be refering to the [Details].Form which is the subform, since what this makes is to make a massive paste on the subform... or may I ask this on VBA forum? :confused:
 

Users who are viewing this thread

Back
Top Bottom