D
doug d via AccessMonster.com
I made a combo box in a form in Access and I put a print button under it. As
of now I have two choices in the combo box ( ABF Systems and Central
Transport). When using the print button I want it to print out three
seperate word files for the chosen combo box option. I am able to print the
first option which is ABF Systems with no problem. However when I print the
second option (Central Trasnport) it print both the ABF Word files and
Central Transport files. How do I stop it. This is the VB code I am using
for the print button. please help I am so close.
Private Sub print_Click()
If Combo1_AfterUpdate = ABF_Systems Then
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
2005 Profiles\abf 2005.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
DAILY TASKS\ABF\ABF DAILY TASKS.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
DAILY TASKS\ABF\ABF CONTACTS.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
End If
If Combo1_AfterUpdate = Central_Transport Then
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
2005 Profiles\Central Transport 2005.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
DAILY TASKS\CENTRAL TRANSPORT\CTII DAILY TASKS.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
DAILY TASKS\CENTRAL TRANSPORT\CTII CONTACTS.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
End If
End Sub
of now I have two choices in the combo box ( ABF Systems and Central
Transport). When using the print button I want it to print out three
seperate word files for the chosen combo box option. I am able to print the
first option which is ABF Systems with no problem. However when I print the
second option (Central Trasnport) it print both the ABF Word files and
Central Transport files. How do I stop it. This is the VB code I am using
for the print button. please help I am so close.
Private Sub print_Click()
If Combo1_AfterUpdate = ABF_Systems Then
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
2005 Profiles\abf 2005.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
DAILY TASKS\ABF\ABF DAILY TASKS.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
DAILY TASKS\ABF\ABF CONTACTS.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
End If
If Combo1_AfterUpdate = Central_Transport Then
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
2005 Profiles\Central Transport 2005.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
DAILY TASKS\CENTRAL TRANSPORT\CTII DAILY TASKS.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
Set wordobj = CreateObject("Word.Basic")
wordobj.FileOpen "N:\Customer Service\Direct Team\Procedure Guide\
DAILY TASKS\CENTRAL TRANSPORT\CTII CONTACTS.doc"
wordobj.fileprint
wordobj.filesave
wordobj.FileClose (1)
Set wordobj = Nothing
End If
End Sub