G
Guest
Thanks for taking the time to read my question.
I have a DB split into Front End and Back End.
I want to make a copy of a table in the back end and then have it linked to
the front end.
How can I do this? I've tried DoCmd.CopyObject but I think it's only
copying the link to the table that is in the front end.
CODE
----------------------------------
Sub CopytblHerdInformation()
On Error GoTo CopytblHerdInformation_Err
DoCmd.DeleteObject acTable, "tblHerdInformationPY"
DoCmd.Rename "tblHerdInformationPY", acTable, "tblHerdInformation"
DoCmd.CopyObject , "tblHerdInformation", acTable, "tblHerdInformationPY"
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE tblHerdInformationPY SET
tblHerdInformationPY.NumberOfFreeVisits = 0, tblHerdInformationPY.New =
False;"
DoCmd.SetWarnings True
CopytblHerdInformation_Exit:
Exit Sub
CopytblHerdInformation_Err:
If Err.Number = 3011 Then
Resume Next
Else
MsgBox Err.Number & ", " & Err.Description
Resume CopytblHerdInformation_Exit
End If
End Sub
I have a DB split into Front End and Back End.
I want to make a copy of a table in the back end and then have it linked to
the front end.
How can I do this? I've tried DoCmd.CopyObject but I think it's only
copying the link to the table that is in the front end.
CODE
----------------------------------
Sub CopytblHerdInformation()
On Error GoTo CopytblHerdInformation_Err
DoCmd.DeleteObject acTable, "tblHerdInformationPY"
DoCmd.Rename "tblHerdInformationPY", acTable, "tblHerdInformation"
DoCmd.CopyObject , "tblHerdInformation", acTable, "tblHerdInformationPY"
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE tblHerdInformationPY SET
tblHerdInformationPY.NumberOfFreeVisits = 0, tblHerdInformationPY.New =
False;"
DoCmd.SetWarnings True
CopytblHerdInformation_Exit:
Exit Sub
CopytblHerdInformation_Err:
If Err.Number = 3011 Then
Resume Next
Else
MsgBox Err.Number & ", " & Err.Description
Resume CopytblHerdInformation_Exit
End If
End Sub