I've got a button on a form copies a record, using "domenuitem" commands in the the following sequence:
1. select record
2. copy record
3. goto new record
4. paste record
That works fine. Next, within the the same sub I want to change a few of the fields on that form, but I've found that the sub quits executing the code right after the paste command. I don't know if its automatically exiting the subprocedure, but I need the subprocedure to continue so I can change the field values. Can someone recommend a way to do this?
Code:
DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord..
DoCmd.DoMenuItem acFormBar, acEditMenu, acCopy.....
DoCmd.GoToRecord , , acNewRec ...
response = MsgBox("recordcreated", vbYesNo, "verify")
DoCmd.DoMenuItem acFormBar, acEditMenu, 3.. 'paste data...
response = MsgBox("recordpasted", vbYesNo, "verify")
Me.HoursBilled = 0
The way I found this out is by using msgbox's as flags. The MSGBOX function on line 4 executes, but the MSGBOX on line 6 doesn't execute.
Thanks,
Joe
1. select record
2. copy record
3. goto new record
4. paste record
That works fine. Next, within the the same sub I want to change a few of the fields on that form, but I've found that the sub quits executing the code right after the paste command. I don't know if its automatically exiting the subprocedure, but I need the subprocedure to continue so I can change the field values. Can someone recommend a way to do this?
Code:
DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord..
DoCmd.DoMenuItem acFormBar, acEditMenu, acCopy.....
DoCmd.GoToRecord , , acNewRec ...
response = MsgBox("recordcreated", vbYesNo, "verify")
DoCmd.DoMenuItem acFormBar, acEditMenu, 3.. 'paste data...
response = MsgBox("recordpasted", vbYesNo, "verify")
Me.HoursBilled = 0
The way I found this out is by using msgbox's as flags. The MSGBOX function on line 4 executes, but the MSGBOX on line 6 doesn't execute.
Thanks,
Joe