Browse records of subform from main form

capsula4

Registered User.
Local time
Today, 07:05
Joined
Jan 3, 2008
Messages
122
Hello helpful friends!!

:D

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 'get position of last rec
DoCmd.GotoRecord,, acFirst 'start pasting from first rec
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...

Thanks in advance!
Luis
 
Something tells me you should look into using dao recordsets to do this - :)
 
Thanks!!

I could make it by using the following code:

Code:
Dim rs As DAO.Recordset
Set rs = [Details].Form.Recordset
rs.MoveFirst
Do until rs.eof
[Details].Form![FieldToBePasted]=Me![FieldWithInfo]
rs.MoveNext
Loop

Thanks a lot Ken for the help!
 

Users who are viewing this thread

Back
Top Bottom