officemanager2
Technical User
I have a form for membership info that has a button to export the info onto a publisher document. This was working fine on an old computer but when I transferred both the database and the publisher file to a different computer it no longer works.
The code looks like:
Private Sub Transfer_Click()
On Error GoTo Err_Transfer_Click
Dim oApp As Publisher.Application
Dim oPub As Publisher.Document
Dim Path As String
Dim tPath As String
Set oApp = CreateObject("Publisher.Application")
tPath = "C:\Documents and Settings\TGD\Desktop\membership"
Path = tPath + "/membershipcard.pub"
Set oPub = oApp.Open(Path)
oPub.Application.ActiveWindow.Visible = True
Me.Number.SetFocus
oPub.MailMerge.DataSource.Filters.Add "Number", msoFilterComparisonEqual, msoFilterConjunctionAnd, Me.Number.Text, False
''todo make it show merge results automatically
Exit_Transfer_Click:
Exit Sub
Err_Transfer_Click:
MsgBox Err.Description
Resume Exit_Transfer_Click
End Sub
For some reason when I click the button that should transfer the fields to Publisher an error message comes up that Publisher cannot find the file? The error message also says to make sure the floppy disc is inserted. I have no idea where the floppy disc comment is coming from, but more to the point cannot create any membership cards using the button on the database.
Once info is in the database I can go through the Publisher file to import the fields in, but would prefer to get this button working again.
Any suggestions?
The code looks like:
Private Sub Transfer_Click()
On Error GoTo Err_Transfer_Click
Dim oApp As Publisher.Application
Dim oPub As Publisher.Document
Dim Path As String
Dim tPath As String
Set oApp = CreateObject("Publisher.Application")
tPath = "C:\Documents and Settings\TGD\Desktop\membership"
Path = tPath + "/membershipcard.pub"
Set oPub = oApp.Open(Path)
oPub.Application.ActiveWindow.Visible = True
Me.Number.SetFocus
oPub.MailMerge.DataSource.Filters.Add "Number", msoFilterComparisonEqual, msoFilterConjunctionAnd, Me.Number.Text, False
''todo make it show merge results automatically
Exit_Transfer_Click:
Exit Sub
Err_Transfer_Click:
MsgBox Err.Description
Resume Exit_Transfer_Click
End Sub
For some reason when I click the button that should transfer the fields to Publisher an error message comes up that Publisher cannot find the file? The error message also says to make sure the floppy disc is inserted. I have no idea where the floppy disc comment is coming from, but more to the point cannot create any membership cards using the button on the database.
Once info is in the database I can go through the Publisher file to import the fields in, but would prefer to get this button working again.
Any suggestions?