Copy and Paste Record

D

Dave Elliott

I have a Customer form that I want to use to export name, address, etc..
into another form called TimeCards.
Here is the code that I use to accomplish this.
However, the TimeCards form has a combo (DropDown) List box for it's
Customer.
After using this code it inserts everything but the Customer. After tabbing
down to the next field, then it inserts the Customer.
This Customer field on the TimeCards form performs a lookup function that
looks up and fills in the name, address, city, phone after choosing the
customer.
What can I do if anything to make it fill in the customer, maybe by itself
and then move on to next field, which will be the Date field.


Thanks,

Dave



On Error GoTo Err_Command17_Click
Dim stDocName As String
Dim stlinkCriteria As String

stDocName = "TimeCards"
DoCmd.OpenForm stDocName, , , stlinkCriteria
Forms![TimeCards]![NameA] = Forms![Customers]![Customers]
Forms![TimeCards]![Address] = Forms![Customers]![Address]
Forms![TimeCards]![City] = Forms![Customers]![City]
Forms![TimeCards]![Phone] = Forms![Customers]![Phone]
DoCmd.Close acForm, Me.Name


Exit_Command17_Click:
Exit Sub

Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top