Saving record and clearing form

CanWest

Registered User.
Local time
Today, 14:28
Joined
Sep 15, 2006
Messages
272
I have a command button that i need to be able to save the current record in a completely different form and then start a new record in that same form.

I tried
Code:
Forms!hfrm_PerSerOrgSerAssoc.Form.NewRecord
but that did not work. Can anyone assist me with this one

Thanks
 
What's the relationship between the two forms? Is your first form bound to a table? How about your second form?
 
What's the relationship between the two forms? Is your first form bound to a table? How about your second form?

There is no relationship between the forms but both are bound to separate tables.
 
Records aren't saved in forms, they're saved in tables. Data is only displayed in forms.

Are you saying that you want to save the current record in the table that your first form is based on as well as in the table taht your second form is based on? And if so, why? Storing identical records in multiple tables violates one of the cardinal rules of relational databases.

Linq ;0)>
 
Records aren't saved in forms, they're saved in tables. Data is only displayed in forms.

Are you saying that you want to save the current record in the table that your first form is based on as well as in the table taht your second form is based on? And if so, why? Storing identical records in multiple tables violates one of the cardinal rules of relational databases.

Linq ;0)>

They are not identical records. They are two separate forms based on two separate tables. On the save command button in the first form I have placed several 'setvalue' commands that update the second form. I need to save the current record that is displayed in the second form and then clear the second form ready for the next record.
 
To do what you're trying to do I would normally create a sub or function on the "other form" (the one you want to do a save on) that handles the save and then call it from your first form.

Code:
Public Function SaveFormData()
     DoCmd.RunCommand acCmdSaveRecord
End Function

'I'm assuming you want to do the save on a main form, not a subform
'Here's how you call the Function named SaveFormData
Call Forms("frmMainFormName").SaveFormData
 
As is obvious, I was a little late posting. My idea still applies. You just need to put the GoToRecord code in the function SaveFormData, or whatever other code you want in there.
 

Users who are viewing this thread

Back
Top Bottom