Solved SetValue in macro for continuous subform from the parent form (1 Viewer)

saledo2000

Registered User.
Local time
Today, 04:52
Joined
Jan 21, 2013
Messages
94
Hi Everybody,
I would like to setvalue of ID_No which is on the continuous subform from the parent form. I know how to setvalue of the ID_No on the parent form but would like to setvalue of the continuous subform from the main form when I open the next form using command button on the parent form. I have tried to do it and getting only the first record of the subform in my next form. I have noticed that value is passed for active record on the continuous subform. I am wondering how to move to the next record (little triangle on the record selector on the continuous subform). Is this possible to do it.
Thank you.
 

June7

AWF VIP
Local time
Yesterday, 20:52
Joined
Mar 9, 2014
Messages
5,424
Why do you even need SetValue for parent form? Isn't the key an autonumber field?

With a form/subform arrangement, all you should have to do is set subform container Master/Child Links properties. The primary key from main form will automatically populate to foreign key field of subform.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:52
Joined
May 7, 2009
Messages
19,169
you need to SetFocus on the subform first before you can move to its record.
add a button that will move the record of your subform.
on it's click event:
Code:
Private Sub button_Click()
On Error Resume Next
Forms!mainFormNameHere!SubformNameHere.SetFocus
DoCmd.GotoRecord , , acNext
End Sub
 

saledo2000

Registered User.
Local time
Today, 04:52
Joined
Jan 21, 2013
Messages
94
you need to SetFocus on the subform first before you can move to its record.
add a button that will move the record of your subform.
on it's click event:
Code:
Private Sub button_Click()
On Error Resume Next
Forms!mainFormNameHere!SubformNameHere.SetFocus
DoCmd.GotoRecord , , acNext
End Sub

Thank you,
I thought the same. Thank you very much. Just wanted to be sure.
Cheers
 

Users who are viewing this thread

Top Bottom