Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

link publisher file to data base

Status
Not open for further replies.

officemanager2

Technical User
Oct 11, 2007
116
CA
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?
 
I'd change this:
Path = tPath + "/membershipcard.pub"
with this:
Path = tPath + "\membershipcard.pub"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks, I've tried that, I can repost the code, but as it stands that change has been made and the issue remains. Very odd???
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top