copy value from form to subform

theinviter

Registered User.
Local time
, 20:27
Joined
Aug 14, 2014
Messages
273
Hi guys;

need help please

i have a form and subform, so i created a button to add the value from from to specific filed in subform in new record , i tried the below code but got this error code "the setting you entered isnt valid for this property"


Private Sub Command1608_Click()

Me.[cycle subform].Form.Cycle = Me.No_of_Cycle.Value
Me.[cycle subform].Form.date_ = Date

End Sub

how to solve this issue
 
Try bracketing "Cycle". It's a reserved word, as it is a property of the form.
 
Hi. Do you know which one is causing the error? If not, try them out one at a time. Maybe it has something to do with the data.
 
done i changed the field to cycle1 but i want the date upon click it go to new reccod in subform and paste the value.
how to do that
 
i tried this code but did not work


Me.[cycle subform].SetFocus
DoCmd.GoToControl ([Cycle1])
DoCmd.GoToRecord , , acNew
Me.[cycle subform].Form.Cycle1 = Me.No_of_Cycle.Value
Me.[cycle subform].Form.date_ = Date

End Sub
 
done guys

thank you

i done with this code:
On Error GoTo new_Err

Me.[cycle subform].SetFocus 'sets the focus to sfrm_Each_Book_subform
DoCmd.RunCommand acCmdRecordsGoToNew
new_Err:
Me.[cycle subform].Form.Cycle1 = Me.No_of_Cycle.Value
Me.[cycle subform].Form.date_ = Date
 

Users who are viewing this thread

Back
Top Bottom