D
Dave Elliott
I have some code that opens a form named TimeCards and then copies data into
it and then I want it to close the active form from wher the data came from
which is named Customers.
What is wrong with my code ?
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
Exit_Command17_Click:
Exit Sub
Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click
it and then I want it to close the active form from wher the data came from
which is named Customers.
What is wrong with my code ?
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
Exit_Command17_Click:
Exit Sub
Err_Command17_Click:
MsgBox Err.Description
Resume Exit_Command17_Click