My task is to place a button in the form clients,with which to open the form Customers, go to a new record, and populate this new customer
with the data from the client. This client should be then deleted, since he is becoming customer already.
With the following code i open the new form,go to a new record, but then the data are not transferred :
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = “FCustomers”
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , “”, acNewRec
DoCmd.GoToControl “customerid”
Dim f As Form
Set f = Forms![FCustomers]
f![CompanyName] = Me![CompanyName]
f![City] = Me![city]
f![phone] = Me![phone]
RunCommand acCmdDeleteRecord