Hello Experts,
A seemingly simple task has turned out to be unexpectedly difficult. Here’s what I’m trying to do:
I have a main form with a subform in it. I have a command button on the main form for users to add a new record to the main form (DoCmd.GoToRecord , , acNewRec). No problem.
However, I would also like to add a new record (with a certain value) in the subform the same time a user is creating a new record to the main form.
Here’s what I have to insert the new value into the subform:
The problem is I can’t seem to get both working in the same command button.
Any/all help or suggestions would be greatly appreciated!!!
- Tom
A seemingly simple task has turned out to be unexpectedly difficult. Here’s what I’m trying to do:
I have a main form with a subform in it. I have a command button on the main form for users to add a new record to the main form (DoCmd.GoToRecord , , acNewRec). No problem.
However, I would also like to add a new record (with a certain value) in the subform the same time a user is creating a new record to the main form.
Here’s what I have to insert the new value into the subform:
Code:
'sets the focus on the subform
Me![sfrm_Details].SetFocus
Me![sfrm_Details]![Details_Text].SetFocus
'go to new record
DoCmd.GoToRecord , , acNewRec
Me![sfrm_Details].SetFocus
Me![sfrm_Details]![Details_Text].Value = "New Request"
The problem is I can’t seem to get both working in the same command button.
Any/all help or suggestions would be greatly appreciated!!!
- Tom