Open MS Word in Access 2007

K

KADL

I inherited an unconvertable Access 2003 application in Access 2007 and it no
longer opens Word where it used to.

A Form button creates a merge file and then using a path and .doc name from
a table used to open (in Access 2003) the Word doc displaying the merged data.

Now the merge file is created but Word doesn't open.

As I read the code, I'm not sure of what command was opening Word. Can you
tell me what that is in Access 2003 and if Access 2007 requires something
else? Is there perhaps something that needs to be done on the Word side?

Thanks!
 
D

Daniel Pineault

If it is a reference issue as Gina has suggested it could be, you can quickly
find out by:

Open the VBE
On the Standard Toolbar, goto Tools - References

Take a look at the top of the listing to see if any are marked as Missing.
If so you need to scroll through the list of available references and select
the version that you have at your disposal.

For instance you might have Microsoft Excel 11.0 Object Library as missing
and instead you have Microsoft Excel 12.0 Object Library as a choice.

Give it a shot and let us know.
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
K

KADL

Thanks, Gina and Daniel. The Word 12.0 object library was indeed missing. I
added it but I can't test it from the machine I'm on now. I'll be able to
test it tomorrow and I'll let you know how it goes.

Thanks again,
KADL
 
K

KADL

Darn. I check the references used in the 2003 version of the app (on a 2003
installed machine) and it doesn't even use the MS Word obj lib. I remembered
that when a required reference is missing, that reference is listed below the
checked references with the word 'missing' next to it.

I'm still going to go try it tomorrow, but I am not hopeful.

Any other ideas for me to try while I'm there tomorrow?

Thanks,
Krisse
 
K

KADL

I'm not sure what to look for. What is the command or function for caling MS
Word?
 
G

Gina Whipp

The form where the command button is located...

1. Open it Design View
2. Click the Code button located on the Menu Bar (kinda looks like a blue
square)
3. On the Menu Bar select Edit... Select All... back to Edit... Copy...
4. Open new message and Paste here

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
K

KADL

There is so much code, I was trying to narrow down what you would need to
see. There are gosubs and user defined functions, so I hope I didn't miss
anything. The first time the button is clicked, another field combo box
appears for the user to select a word doc that they want to use. when the
user clicks the button again it creates a merge file of the displayed person
and the Word doc opens with the data merged in. First I pasted the important
called function. Note that there are commented out lines in here, too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM", Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers", "[UserID] =
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases Qry" table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode As String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String, Judgeinitstring As String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control Table", "[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:

GoSub Build_CaseString
DoCmd.SetWarnings False
DocName = "FAL Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT ' CaseString or Casenumbers

DocName = "FAL Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

GoSub Add_Case_to_WW
' DoCmd.TransferText acExportDelim, "Standard Output", "External Report",
"C:\Txtfiles\April.doc"
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FAL",
"c:\FALDEFT.TXT", True
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FALDET",
"c:\FALDET.TXT", True

'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP KEEP
KEEP ----------------------------*
' DoCmd.TransferText acExportDelim, , "WW_FAL", "c:\FALDEFT.TXT", True
'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP KEEP
KEEP ----------------------------*
' Next line outputs an excel spread sheet c:\faldeftx
DYN_faldeft
' next line outputs text file to c:\faldeft.txt
write_faldeft

' Word_command = GetSetting(appname:="ICM", Section:="mswordname", _
' Key:="appname", Default:="25")
Word_command = get_Cur_Pbomsword()
If Word_command = "25" Then
MsgBox "ICM unable to Start MS Word. Report this error. Data has
probably been posted correctly. Try starting MS Word manualy and open the
document."
End If

wpdir = get_Pbo_wpdirectory()
stuff = Word_command & " " & qt & wpdir & Me.Form![FAL Form id] & qt
x = Shell(stuff, 1)

' add stat
DoEvents
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc subform].Form![CHCCID]
' Court = forms![Defendant Lookup Form]![CHCC Subform].form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
' add file note
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)


Return

Build_CaseString:
casestring = ""
Courtstring = ""
Judgeinitstring = ""

Set inset = db.OpenRecordset("Defendant Cases Qry", DB_OPEN_DYNASET,
dbSeeChanges)

inCriteria = "[CHCCID] = " & Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
inset.FindFirst inCriteria
comma = ""
Do Until inset.NoMatch
casestring = casestring & comma & inset![Casenumber]
Courtstring = Courtstring & comma & inset![Court]
' Judgeinitstring = Judgeinitstring & comma & inset![Judgeinit]
' no judge info on case level anymore
comma = ", "
inset.FindNext inCriteria
Loop

inset.close


' Forms![Defendant Lookup Form]![Cases Subform].form![Casenumber]
Return

Add_Case_to_WW:
Set inset = db.OpenRecordset("WW_FAL", DB_OPEN_DYNASET, dbSeeChanges)

inCriteria = "[Deftid] > 0 "
inset.FindFirst inCriteria
If inset.NoMatch Then
Debug.Print "oops"
Else
inset.Edit
inset("Casenumbers") = casestring
inset("Courts") = Courtstring
' inset("Judgeinits") = Judgeinitstring
'no judge info in case file anymore.
inset.Update
End If
inset.close
Return

End Sub
 
G

Gina Whipp

Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to Word is set
and it's looking for WOrd in a specific folder. And since it's not in this
bit of code it must be somewhere else. Do the machines at work only have
Office 2007? Do you see any modules under the module tab in your database?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
There is so much code, I was trying to narrow down what you would need to
see. There are gosubs and user defined functions, so I hope I didn't miss
anything. The first time the button is clicked, another field combo box
appears for the user to select a word doc that they want to use. when the
user clicks the button again it creates a merge file of the displayed
person
and the Word doc opens with the data merged in. First I pasted the
important
called function. Note that there are commented out lines in here, too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM", Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers", "[UserID] =
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases Qry" table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode As String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String, Judgeinitstring As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control Table", "[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc
subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:

GoSub Build_CaseString
DoCmd.SetWarnings False
DocName = "FAL Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT ' CaseString or Casenumbers

DocName = "FAL Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

GoSub Add_Case_to_WW
' DoCmd.TransferText acExportDelim, "Standard Output", "External
Report",
"C:\Txtfiles\April.doc"
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FAL",
"c:\FALDEFT.TXT", True
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FALDET",
"c:\FALDET.TXT", True

'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP KEEP
KEEP ----------------------------*
' DoCmd.TransferText acExportDelim, , "WW_FAL", "c:\FALDEFT.TXT", True
'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP KEEP
KEEP ----------------------------*
' Next line outputs an excel spread sheet c:\faldeftx
DYN_faldeft
' next line outputs text file to c:\faldeft.txt
write_faldeft

' Word_command = GetSetting(appname:="ICM", Section:="mswordname", _
' Key:="appname", Default:="25")
Word_command = get_Cur_Pbomsword()
If Word_command = "25" Then
MsgBox "ICM unable to Start MS Word. Report this error. Data has
probably been posted correctly. Try starting MS Word manualy and open the
document."
End If

wpdir = get_Pbo_wpdirectory()
stuff = Word_command & " " & qt & wpdir & Me.Form![FAL Form id] & qt
x = Shell(stuff, 1)

' add stat
DoEvents
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc subform].Form![CHCCID]
' Court = forms![Defendant Lookup Form]![CHCC Subform].form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
' add file note
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)


Return

Build_CaseString:
casestring = ""
Courtstring = ""
Judgeinitstring = ""

Set inset = db.OpenRecordset("Defendant Cases Qry", DB_OPEN_DYNASET,
dbSeeChanges)

inCriteria = "[CHCCID] = " & Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
inset.FindFirst inCriteria
comma = ""
Do Until inset.NoMatch
casestring = casestring & comma & inset![Casenumber]
Courtstring = Courtstring & comma & inset![Court]
' Judgeinitstring = Judgeinitstring & comma & inset![Judgeinit]
' no judge info on case level anymore
comma = ", "
inset.FindNext inCriteria
Loop

inset.close


' Forms![Defendant Lookup Form]![Cases Subform].form![Casenumber]
Return

Add_Case_to_WW:
Set inset = db.OpenRecordset("WW_FAL", DB_OPEN_DYNASET, dbSeeChanges)

inCriteria = "[Deftid] > 0 "
inset.FindFirst inCriteria
If inset.NoMatch Then
Debug.Print "oops"
Else
inset.Edit
inset("Casenumbers") = casestring
inset("Courts") = Courtstring
' inset("Judgeinits") = Judgeinitstring
'no judge info in case file anymore.
inset.Update
End If
inset.close
Return

End Sub




Gina Whipp said:
The form where the command button is located...

1. Open it Design View
2. Click the Code button located on the Menu Bar (kinda looks like a blue
square)
3. On the Menu Bar select Edit... Select All... back to Edit... Copy...
4. Open new message and Paste here

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
K

KADL

Yes, there are several modules. I found that function definition I pasted
below in one of them. I did a search for a path to Word and didn't find one.

Gina Whipp said:
Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to Word is set
and it's looking for WOrd in a specific folder. And since it's not in this
bit of code it must be somewhere else. Do the machines at work only have
Office 2007? Do you see any modules under the module tab in your database?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
There is so much code, I was trying to narrow down what you would need to
see. There are gosubs and user defined functions, so I hope I didn't miss
anything. The first time the button is clicked, another field combo box
appears for the user to select a word doc that they want to use. when the
user clicks the button again it creates a merge file of the displayed
person
and the Word doc opens with the data merged in. First I pasted the
important
called function. Note that there are commented out lines in here, too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM", Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers", "[UserID] =
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases Qry" table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode As String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String, Judgeinitstring As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control Table", "[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc
subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:

GoSub Build_CaseString
DoCmd.SetWarnings False
DocName = "FAL Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT ' CaseString or Casenumbers

DocName = "FAL Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

GoSub Add_Case_to_WW
' DoCmd.TransferText acExportDelim, "Standard Output", "External
Report",
"C:\Txtfiles\April.doc"
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FAL",
"c:\FALDEFT.TXT", True
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FALDET",
"c:\FALDET.TXT", True

'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP KEEP
KEEP ----------------------------*
' DoCmd.TransferText acExportDelim, , "WW_FAL", "c:\FALDEFT.TXT", True
'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP KEEP
KEEP ----------------------------*
' Next line outputs an excel spread sheet c:\faldeftx
DYN_faldeft
' next line outputs text file to c:\faldeft.txt
write_faldeft

' Word_command = GetSetting(appname:="ICM", Section:="mswordname", _
' Key:="appname", Default:="25")
Word_command = get_Cur_Pbomsword()
If Word_command = "25" Then
MsgBox "ICM unable to Start MS Word. Report this error. Data has
probably been posted correctly. Try starting MS Word manualy and open the
document."
End If

wpdir = get_Pbo_wpdirectory()
stuff = Word_command & " " & qt & wpdir & Me.Form![FAL Form id] & qt
x = Shell(stuff, 1)

' add stat
DoEvents
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc subform].Form![CHCCID]
' Court = forms![Defendant Lookup Form]![CHCC Subform].form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
' add file note
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)


Return

Build_CaseString:
casestring = ""
Courtstring = ""
Judgeinitstring = ""

Set inset = db.OpenRecordset("Defendant Cases Qry", DB_OPEN_DYNASET,
dbSeeChanges)

inCriteria = "[CHCCID] = " & Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
inset.FindFirst inCriteria
comma = ""
Do Until inset.NoMatch
casestring = casestring & comma & inset![Casenumber]
Courtstring = Courtstring & comma & inset![Court]
' Judgeinitstring = Judgeinitstring & comma & inset![Judgeinit]
' no judge info on case level anymore
comma = ", "
inset.FindNext inCriteria
Loop

inset.close


' Forms![Defendant Lookup Form]![Cases Subform].form![Casenumber]
Return

Add_Case_to_WW:
Set inset = db.OpenRecordset("WW_FAL", DB_OPEN_DYNASET, dbSeeChanges)

inCriteria = "[Deftid] > 0 "
inset.FindFirst inCriteria
If inset.NoMatch Then
Debug.Print "oops"
Else
inset.Edit
inset("Casenumbers") = casestring
inset("Courts") = Courtstring
' inset("Judgeinits") = Judgeinitstring
'no judge info in case file anymore.
inset.Update
End If
inset.close
Return

End Sub




Gina Whipp said:
The form where the command button is located...

1. Open it Design View
2. Click the Code button located on the Menu Bar (kinda looks like a blue
square)
3. On the Menu Bar select Edit... Select All... back to Edit... Copy...
4. Open new message and Paste here

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I'm not sure what to look for. What is the command or function for
caling
MS
Word?


:

Krisse,

We're going to need to see that code... that will go a great way into
 
K

KADL

With your "path to Word" talk I got to thinking. I found a table that had
each user's path to winword.exe!

I'm going to update the data and I'm confident it will work.

Thanks!

KADL

Gina Whipp said:
Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to Word is set
and it's looking for WOrd in a specific folder. And since it's not in this
bit of code it must be somewhere else. Do the machines at work only have
Office 2007? Do you see any modules under the module tab in your database?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
There is so much code, I was trying to narrow down what you would need to
see. There are gosubs and user defined functions, so I hope I didn't miss
anything. The first time the button is clicked, another field combo box
appears for the user to select a word doc that they want to use. when the
user clicks the button again it creates a merge file of the displayed
person
and the Word doc opens with the data merged in. First I pasted the
important
called function. Note that there are commented out lines in here, too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM", Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers", "[UserID] =
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases Qry" table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode As String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String, Judgeinitstring As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control Table", "[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc
subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:

GoSub Build_CaseString
DoCmd.SetWarnings False
DocName = "FAL Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT ' CaseString or Casenumbers

DocName = "FAL Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

GoSub Add_Case_to_WW
' DoCmd.TransferText acExportDelim, "Standard Output", "External
Report",
"C:\Txtfiles\April.doc"
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FAL",
"c:\FALDEFT.TXT", True
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FALDET",
"c:\FALDET.TXT", True

'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP KEEP
KEEP ----------------------------*
' DoCmd.TransferText acExportDelim, , "WW_FAL", "c:\FALDEFT.TXT", True
'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP KEEP
KEEP ----------------------------*
' Next line outputs an excel spread sheet c:\faldeftx
DYN_faldeft
' next line outputs text file to c:\faldeft.txt
write_faldeft

' Word_command = GetSetting(appname:="ICM", Section:="mswordname", _
' Key:="appname", Default:="25")
Word_command = get_Cur_Pbomsword()
If Word_command = "25" Then
MsgBox "ICM unable to Start MS Word. Report this error. Data has
probably been posted correctly. Try starting MS Word manualy and open the
document."
End If

wpdir = get_Pbo_wpdirectory()
stuff = Word_command & " " & qt & wpdir & Me.Form![FAL Form id] & qt
x = Shell(stuff, 1)

' add stat
DoEvents
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc subform].Form![CHCCID]
' Court = forms![Defendant Lookup Form]![CHCC Subform].form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
' add file note
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)


Return

Build_CaseString:
casestring = ""
Courtstring = ""
Judgeinitstring = ""

Set inset = db.OpenRecordset("Defendant Cases Qry", DB_OPEN_DYNASET,
dbSeeChanges)

inCriteria = "[CHCCID] = " & Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
inset.FindFirst inCriteria
comma = ""
Do Until inset.NoMatch
casestring = casestring & comma & inset![Casenumber]
Courtstring = Courtstring & comma & inset![Court]
' Judgeinitstring = Judgeinitstring & comma & inset![Judgeinit]
' no judge info on case level anymore
comma = ", "
inset.FindNext inCriteria
Loop

inset.close


' Forms![Defendant Lookup Form]![Cases Subform].form![Casenumber]
Return

Add_Case_to_WW:
Set inset = db.OpenRecordset("WW_FAL", DB_OPEN_DYNASET, dbSeeChanges)

inCriteria = "[Deftid] > 0 "
inset.FindFirst inCriteria
If inset.NoMatch Then
Debug.Print "oops"
Else
inset.Edit
inset("Casenumbers") = casestring
inset("Courts") = Courtstring
' inset("Judgeinits") = Judgeinitstring
'no judge info in case file anymore.
inset.Update
End If
inset.close
Return

End Sub




Gina Whipp said:
The form where the command button is located...

1. Open it Design View
2. Click the Code button located on the Menu Bar (kinda looks like a blue
square)
3. On the Menu Bar select Edit... Select All... back to Edit... Copy...
4. Open new message and Paste here

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I'm not sure what to look for. What is the command or function for
caling
MS
Word?


:

Krisse,

We're going to need to see that code... that will go a great way into
 
G

Gina Whipp

Hopefully, that works... Let us know!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
With your "path to Word" talk I got to thinking. I found a table that had
each user's path to winword.exe!

I'm going to update the data and I'm confident it will work.

Thanks!

KADL

Gina Whipp said:
Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to Word is
set
and it's looking for WOrd in a specific folder. And since it's not in
this
bit of code it must be somewhere else. Do the machines at work only have
Office 2007? Do you see any modules under the module tab in your
database?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
There is so much code, I was trying to narrow down what you would need
to
see. There are gosubs and user defined functions, so I hope I didn't
miss
anything. The first time the button is clicked, another field combo
box
appears for the user to select a word doc that they want to use. when
the
user clicks the button again it creates a merge file of the displayed
person
and the Word doc opens with the data merged in. First I pasted the
important
called function. Note that there are commented out lines in here, too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM",
Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers", "[UserID] =
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases Qry" table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode As String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String, Judgeinitstring As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table", "[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control Table",
"[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form
id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form
id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc
subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:

GoSub Build_CaseString
DoCmd.SetWarnings False
DocName = "FAL Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT ' CaseString or
Casenumbers

DocName = "FAL Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

GoSub Add_Case_to_WW
' DoCmd.TransferText acExportDelim, "Standard Output", "External
Report",
"C:\Txtfiles\April.doc"
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FAL",
"c:\FALDEFT.TXT", True
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FALDET",
"c:\FALDET.TXT", True

'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP
KEEP
KEEP ----------------------------*
' DoCmd.TransferText acExportDelim, , "WW_FAL", "c:\FALDEFT.TXT",
True
'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP KEEP
KEEP ----------------------------*
' Next line outputs an excel spread sheet c:\faldeftx
DYN_faldeft
' next line outputs text file to c:\faldeft.txt
write_faldeft

' Word_command = GetSetting(appname:="ICM", Section:="mswordname", _
' Key:="appname", Default:="25")
Word_command = get_Cur_Pbomsword()
If Word_command = "25" Then
MsgBox "ICM unable to Start MS Word. Report this error. Data
has
probably been posted correctly. Try starting MS Word manualy and open
the
document."
End If

wpdir = get_Pbo_wpdirectory()
stuff = Word_command & " " & qt & wpdir & Me.Form![FAL Form id] & qt
x = Shell(stuff, 1)

' add stat
DoEvents
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
' Court = forms![Defendant Lookup Form]![CHCC
Subform].form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
' add file note
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)


Return

Build_CaseString:
casestring = ""
Courtstring = ""
Judgeinitstring = ""

Set inset = db.OpenRecordset("Defendant Cases Qry", DB_OPEN_DYNASET,
dbSeeChanges)

inCriteria = "[CHCCID] = " & Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
inset.FindFirst inCriteria
comma = ""
Do Until inset.NoMatch
casestring = casestring & comma & inset![Casenumber]
Courtstring = Courtstring & comma & inset![Court]
' Judgeinitstring = Judgeinitstring & comma & inset![Judgeinit]
' no judge info on case level anymore
comma = ", "
inset.FindNext inCriteria
Loop

inset.close


' Forms![Defendant Lookup Form]![Cases Subform].form![Casenumber]
Return

Add_Case_to_WW:
Set inset = db.OpenRecordset("WW_FAL", DB_OPEN_DYNASET,
dbSeeChanges)

inCriteria = "[Deftid] > 0 "
inset.FindFirst inCriteria
If inset.NoMatch Then
Debug.Print "oops"
Else
inset.Edit
inset("Casenumbers") = casestring
inset("Courts") = Courtstring
' inset("Judgeinits") = Judgeinitstring
'no judge info in case file anymore.
inset.Update
End If
inset.close
Return

End Sub




:

The form where the command button is located...

1. Open it Design View
2. Click the Code button located on the Menu Bar (kinda looks like a
blue
square)
3. On the Menu Bar select Edit... Select All... back to Edit...
Copy...
4. Open new message and Paste here

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I'm not sure what to look for. What is the command or function for
caling
MS
Word?


:

Krisse,

We're going to need to see that code... that will go a great way
into
 
K

KADL

Darn! Users are still getting either a "Path Not Found" or a "File Not Found"
error.

I didn't touch the wpdirectory field of the table "Probation Officers"
(which tells where the Word doc can be found). The data is an intranet path
that didn't change and that worked under 2003.

The msword field has a path in quotation marks ("c:\program files\ etc.) I
changed only the 11 (Office11) to a 12 (Office12).

I verified both paths as matching what is on the user's machine. She also
verified that there is no longer an Office11 folder.

Luckily I was able to give the user's a workaround since the command button
does correctly create the merge file. They can open the desired Word doc
manually.

Could Access 2007 running in compatibility mode be reading those paths
differently than 2003 does? One has the \\path and the other has the "C:\.."
path

Any other ideas before I tell them they have to live with the inconvenience
of the workaround?

Thanks,
KADL

Gina Whipp said:
Hopefully, that works... Let us know!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
With your "path to Word" talk I got to thinking. I found a table that had
each user's path to winword.exe!

I'm going to update the data and I'm confident it will work.

Thanks!

KADL

Gina Whipp said:
Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to Word is
set
and it's looking for WOrd in a specific folder. And since it's not in
this
bit of code it must be somewhere else. Do the machines at work only have
Office 2007? Do you see any modules under the module tab in your
database?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is so much code, I was trying to narrow down what you would need
to
see. There are gosubs and user defined functions, so I hope I didn't
miss
anything. The first time the button is clicked, another field combo
box
appears for the user to select a word doc that they want to use. when
the
user clicks the button again it creates a merge file of the displayed
person
and the Word doc opens with the data merged in. First I pasted the
important
called function. Note that there are commented out lines in here, too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM",
Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers", "[UserID] =
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases Qry" table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode As String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String, Judgeinitstring As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table", "[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control Table",
"[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form
id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form
id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc
subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:

GoSub Build_CaseString
DoCmd.SetWarnings False
DocName = "FAL Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT ' CaseString or
Casenumbers

DocName = "FAL Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

GoSub Add_Case_to_WW
' DoCmd.TransferText acExportDelim, "Standard Output", "External
Report",
"C:\Txtfiles\April.doc"
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FAL",
"c:\FALDEFT.TXT", True
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FALDET",
"c:\FALDET.TXT", True

'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP
KEEP
KEEP ----------------------------*
' DoCmd.TransferText acExportDelim, , "WW_FAL", "c:\FALDEFT.TXT",
True
'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP KEEP
KEEP ----------------------------*
' Next line outputs an excel spread sheet c:\faldeftx
DYN_faldeft
' next line outputs text file to c:\faldeft.txt
write_faldeft

' Word_command = GetSetting(appname:="ICM", Section:="mswordname", _
' Key:="appname", Default:="25")
Word_command = get_Cur_Pbomsword()
If Word_command = "25" Then
MsgBox "ICM unable to Start MS Word. Report this error. Data
has
probably been posted correctly. Try starting MS Word manualy and open
the
document."
End If

wpdir = get_Pbo_wpdirectory()
stuff = Word_command & " " & qt & wpdir & Me.Form![FAL Form id] & qt
x = Shell(stuff, 1)

' add stat
DoEvents
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
' Court = forms![Defendant Lookup Form]![CHCC
Subform].form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
' add file note
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)


Return

Build_CaseString:
casestring = ""
Courtstring = ""
Judgeinitstring = ""

Set inset = db.OpenRecordset("Defendant Cases Qry", DB_OPEN_DYNASET,
dbSeeChanges)

inCriteria = "[CHCCID] = " & Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
inset.FindFirst inCriteria
comma = ""
Do Until inset.NoMatch
casestring = casestring & comma & inset![Casenumber]
Courtstring = Courtstring & comma & inset![Court]
' Judgeinitstring = Judgeinitstring & comma & inset![Judgeinit]
' no judge info on case level anymore
comma = ", "
inset.FindNext inCriteria
Loop

inset.close


' Forms![Defendant Lookup Form]![Cases Subform].form![Casenumber]
Return

Add_Case_to_WW:
Set inset = db.OpenRecordset("WW_FAL", DB_OPEN_DYNASET,
dbSeeChanges)

inCriteria = "[Deftid] > 0 "
inset.FindFirst inCriteria
If inset.NoMatch Then
Debug.Print "oops"
Else
inset.Edit
inset("Casenumbers") = casestring
inset("Courts") = Courtstring
 
G

Gina Whipp

Is Word loaded locally for each User? Did you verify that that path to
Office 12 is what is located in the table?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
Darn! Users are still getting either a "Path Not Found" or a "File Not
Found"
error.

I didn't touch the wpdirectory field of the table "Probation Officers"
(which tells where the Word doc can be found). The data is an intranet
path
that didn't change and that worked under 2003.

The msword field has a path in quotation marks ("c:\program files\ etc.)
I
changed only the 11 (Office11) to a 12 (Office12).

I verified both paths as matching what is on the user's machine. She also
verified that there is no longer an Office11 folder.

Luckily I was able to give the user's a workaround since the command
button
does correctly create the merge file. They can open the desired Word doc
manually.

Could Access 2007 running in compatibility mode be reading those paths
differently than 2003 does? One has the \\path and the other has the
"C:\.."
path

Any other ideas before I tell them they have to live with the
inconvenience
of the workaround?

Thanks,
KADL

Gina Whipp said:
Hopefully, that works... Let us know!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
With your "path to Word" talk I got to thinking. I found a table that
had
each user's path to winword.exe!

I'm going to update the data and I'm confident it will work.

Thanks!

KADL

:

Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to Word
is
set
and it's looking for WOrd in a specific folder. And since it's not in
this
bit of code it must be somewhere else. Do the machines at work only
have
Office 2007? Do you see any modules under the module tab in your
database?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is so much code, I was trying to narrow down what you would
need
to
see. There are gosubs and user defined functions, so I hope I
didn't
miss
anything. The first time the button is clicked, another field combo
box
appears for the user to select a word doc that they want to use.
when
the
user clicks the button again it creates a merge file of the
displayed
person
and the Word doc opens with the data merged in. First I pasted the
important
called function. Note that there are commented out lines in here,
too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM",
Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers", "[UserID]
=
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases Qry"
table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode As
String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String, Judgeinitstring
As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table", "[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table", "[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control Table",
"[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form
id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form
id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc
subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:

GoSub Build_CaseString
DoCmd.SetWarnings False
DocName = "FAL Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT ' CaseString or
Casenumbers

DocName = "FAL Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

GoSub Add_Case_to_WW
' DoCmd.TransferText acExportDelim, "Standard Output", "External
Report",
"C:\Txtfiles\April.doc"
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FAL",
"c:\FALDEFT.TXT", True
' DoCmd.TransferText acExportDelim, "Defendant import",
"WW_FALDET",
"c:\FALDET.TXT", True

'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP
KEEP
KEEP ----------------------------*
' DoCmd.TransferText acExportDelim, , "WW_FAL", "c:\FALDEFT.TXT",
True
'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP
KEEP
KEEP ----------------------------*
' Next line outputs an excel spread sheet c:\faldeftx
DYN_faldeft
' next line outputs text file to c:\faldeft.txt
write_faldeft

' Word_command = GetSetting(appname:="ICM",
Section:="mswordname", _
' Key:="appname", Default:="25")
Word_command = get_Cur_Pbomsword()
If Word_command = "25" Then
MsgBox "ICM unable to Start MS Word. Report this error.
Data
has
probably been posted correctly. Try starting MS Word manualy and
open
the
document."
End If

wpdir = get_Pbo_wpdirectory()
stuff = Word_command & " " & qt & wpdir & Me.Form![FAL Form id] &
qt
x = Shell(stuff, 1)

' add stat
DoEvents
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
' Court = forms![Defendant Lookup Form]![CHCC
Subform].form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
' add file note
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)


Return

Build_CaseString:
casestring = ""
Courtstring = ""
Judgeinitstring = ""

Set inset = db.OpenRecordset("Defendant Cases Qry",
DB_OPEN_DYNASET,
dbSeeChanges)

inCriteria = "[CHCCID] = " & Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
inset.FindFirst inCriteria
comma = ""
Do Until inset.NoMatch
casestring = casestring & comma & inset![Casenumber]
Courtstring = Courtstring & comma & inset![Court]
' Judgeinitstring = Judgeinitstring & comma &
inset![Judgeinit]
' no judge info on case level anymore
comma = ", "
inset.FindNext inCriteria
Loop

inset.close


' Forms![Defendant Lookup Form]![Cases Subform].form![Casenumber]
Return

Add_Case_to_WW:
Set inset = db.OpenRecordset("WW_FAL", DB_OPEN_DYNASET,
dbSeeChanges)

inCriteria = "[Deftid] > 0 "
inset.FindFirst inCriteria
If inset.NoMatch Then
Debug.Print "oops"
Else
inset.Edit
inset("Casenumbers") = casestring
inset("Courts") = Courtstring
 
K

KADL

Yes. The users all were upgraded to the Office 2007 suite this week. They
run Word (and the other suite apps) locally and the path in the table is
correct. The only thing different from last week is that the Office suite is
now in an Office12 folder instead of an Office11 folder for the 2003 suite
and I edited the data replacing the "11" with "12".

Thanks for staying with me, Gina.


Gina Whipp said:
Is Word loaded locally for each User? Did you verify that that path to
Office 12 is what is located in the table?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
Darn! Users are still getting either a "Path Not Found" or a "File Not
Found"
error.

I didn't touch the wpdirectory field of the table "Probation Officers"
(which tells where the Word doc can be found). The data is an intranet
path
that didn't change and that worked under 2003.

The msword field has a path in quotation marks ("c:\program files\ etc.)
I
changed only the 11 (Office11) to a 12 (Office12).

I verified both paths as matching what is on the user's machine. She also
verified that there is no longer an Office11 folder.

Luckily I was able to give the user's a workaround since the command
button
does correctly create the merge file. They can open the desired Word doc
manually.

Could Access 2007 running in compatibility mode be reading those paths
differently than 2003 does? One has the \\path and the other has the
"C:\.."
path

Any other ideas before I tell them they have to live with the
inconvenience
of the workaround?

Thanks,
KADL

Gina Whipp said:
Hopefully, that works... Let us know!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With your "path to Word" talk I got to thinking. I found a table that
had
each user's path to winword.exe!

I'm going to update the data and I'm confident it will work.

Thanks!

KADL

:

Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to Word
is
set
and it's looking for WOrd in a specific folder. And since it's not in
this
bit of code it must be somewhere else. Do the machines at work only
have
Office 2007? Do you see any modules under the module tab in your
database?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is so much code, I was trying to narrow down what you would
need
to
see. There are gosubs and user defined functions, so I hope I
didn't
miss
anything. The first time the button is clicked, another field combo
box
appears for the user to select a word doc that they want to use.
when
the
user clicks the button again it creates a merge file of the
displayed
person
and the Word doc opens with the data merged in. First I pasted the
important
called function. Note that there are commented out lines in here,
too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM",
Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers", "[UserID]
=
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases Qry"
table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode As
String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String, Judgeinitstring
As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form ID] =
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table", "[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table", "[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control Table",
"[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form
id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL Form
id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc
subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:

GoSub Build_CaseString
DoCmd.SetWarnings False
DocName = "FAL Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT ' CaseString or
Casenumbers

DocName = "FAL Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

GoSub Add_Case_to_WW
' DoCmd.TransferText acExportDelim, "Standard Output", "External
Report",
"C:\Txtfiles\April.doc"
' DoCmd.TransferText acExportDelim, "Defendant import", "WW_FAL",
"c:\FALDEFT.TXT", True
' DoCmd.TransferText acExportDelim, "Defendant import",
"WW_FALDET",
"c:\FALDET.TXT", True

'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP
KEEP
KEEP ----------------------------*
' DoCmd.TransferText acExportDelim, , "WW_FAL", "c:\FALDEFT.TXT",
True
'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP KEEP
KEEP
KEEP ----------------------------*
' Next line outputs an excel spread sheet c:\faldeftx
DYN_faldeft
' next line outputs text file to c:\faldeft.txt
write_faldeft

' Word_command = GetSetting(appname:="ICM",
Section:="mswordname", _
' Key:="appname", Default:="25")
Word_command = get_Cur_Pbomsword()
If Word_command = "25" Then
MsgBox "ICM unable to Start MS Word. Report this error.
 
G

Gina Whipp

I am going to run some tests... because now my thinking is Access 2003 and
Word 2007 don't play nice together and that is why nothing we are doing is
working.

Not giving up... on a mission now :cool:
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
Yes. The users all were upgraded to the Office 2007 suite this week. They
run Word (and the other suite apps) locally and the path in the table is
correct. The only thing different from last week is that the Office suite
is
now in an Office12 folder instead of an Office11 folder for the 2003 suite
and I edited the data replacing the "11" with "12".

Thanks for staying with me, Gina.


Gina Whipp said:
Is Word loaded locally for each User? Did you verify that that path to
Office 12 is what is located in the table?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
Darn! Users are still getting either a "Path Not Found" or a "File Not
Found"
error.

I didn't touch the wpdirectory field of the table "Probation Officers"
(which tells where the Word doc can be found). The data is an intranet
path
that didn't change and that worked under 2003.

The msword field has a path in quotation marks ("c:\program files\
etc.)
I
changed only the 11 (Office11) to a 12 (Office12).

I verified both paths as matching what is on the user's machine. She
also
verified that there is no longer an Office11 folder.

Luckily I was able to give the user's a workaround since the command
button
does correctly create the merge file. They can open the desired Word
doc
manually.

Could Access 2007 running in compatibility mode be reading those paths
differently than 2003 does? One has the \\path and the other has the
"C:\.."
path

Any other ideas before I tell them they have to live with the
inconvenience
of the workaround?

Thanks,
KADL

:

Hopefully, that works... Let us know!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With your "path to Word" talk I got to thinking. I found a table
that
had
each user's path to winword.exe!

I'm going to update the data and I'm confident it will work.

Thanks!

KADL

:

Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to
Word
is
set
and it's looking for WOrd in a specific folder. And since it's not
in
this
bit of code it must be somewhere else. Do the machines at work
only
have
Office 2007? Do you see any modules under the module tab in your
database?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is so much code, I was trying to narrow down what you would
need
to
see. There are gosubs and user defined functions, so I hope I
didn't
miss
anything. The first time the button is clicked, another field
combo
box
appears for the user to select a word doc that they want to use.
when
the
user clicks the button again it creates a merge file of the
displayed
person
and the Word doc opens with the data merged in. First I pasted
the
important
called function. Note that there are commented out lines in
here,
too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM",
Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers",
"[UserID]
=
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases Qry"
table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode As
String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String,
Judgeinitstring
As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form ID]
=
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table",
"[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table", "[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control
Table",
"[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL
Form
id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL
Form
id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc
subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:

GoSub Build_CaseString
DoCmd.SetWarnings False
DocName = "FAL Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT ' CaseString or
Casenumbers

DocName = "FAL Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Delete all WW_FAL"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

DocName = "FALDET Deft NEW QRY"
DoCmd.OpenQuery DocName, A_NORMAL, A_EDIT

GoSub Add_Case_to_WW
' DoCmd.TransferText acExportDelim, "Standard Output",
"External
Report",
"C:\Txtfiles\April.doc"
' DoCmd.TransferText acExportDelim, "Defendant import",
"WW_FAL",
"c:\FALDEFT.TXT", True
' DoCmd.TransferText acExportDelim, "Defendant import",
"WW_FALDET",
"c:\FALDET.TXT", True

'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP
KEEP
KEEP
KEEP ----------------------------*
' DoCmd.TransferText acExportDelim, , "WW_FAL",
"c:\FALDEFT.TXT",
True
'------------------------- OLD CODE KEEP KEEP KEEP KEEP KEEP
KEEP
KEEP
KEEP ----------------------------*
' Next line outputs an excel spread sheet c:\faldeftx
DYN_faldeft
' next line outputs text file to c:\faldeft.txt
write_faldeft

' Word_command = GetSetting(appname:="ICM",
Section:="mswordname", _
' Key:="appname", Default:="25")
Word_command = get_Cur_Pbomsword()
If Word_command = "25" Then
MsgBox "ICM unable to Start MS Word. Report this error.
 
K

KADL

Just to clarify, we are running Access2007, but in compatability mode. We
are not converting the database to 2007.

Gina Whipp said:
I am going to run some tests... because now my thinking is Access 2003 and
Word 2007 don't play nice together and that is why nothing we are doing is
working.

Not giving up... on a mission now :cool:
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
Yes. The users all were upgraded to the Office 2007 suite this week. They
run Word (and the other suite apps) locally and the path in the table is
correct. The only thing different from last week is that the Office suite
is
now in an Office12 folder instead of an Office11 folder for the 2003 suite
and I edited the data replacing the "11" with "12".

Thanks for staying with me, Gina.


Gina Whipp said:
Is Word loaded locally for each User? Did you verify that that path to
Office 12 is what is located in the table?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Darn! Users are still getting either a "Path Not Found" or a "File Not
Found"
error.

I didn't touch the wpdirectory field of the table "Probation Officers"
(which tells where the Word doc can be found). The data is an intranet
path
that didn't change and that worked under 2003.

The msword field has a path in quotation marks ("c:\program files\
etc.)
I
changed only the 11 (Office11) to a 12 (Office12).

I verified both paths as matching what is on the user's machine. She
also
verified that there is no longer an Office11 folder.

Luckily I was able to give the user's a workaround since the command
button
does correctly create the merge file. They can open the desired Word
doc
manually.

Could Access 2007 running in compatibility mode be reading those paths
differently than 2003 does? One has the \\path and the other has the
"C:\.."
path

Any other ideas before I tell them they have to live with the
inconvenience
of the workaround?

Thanks,
KADL

:

Hopefully, that works... Let us know!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With your "path to Word" talk I got to thinking. I found a table
that
had
each user's path to winword.exe!

I'm going to update the data and I'm confident it will work.

Thanks!

KADL

:

Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to
Word
is
set
and it's looking for WOrd in a specific folder. And since it's not
in
this
bit of code it must be somewhere else. Do the machines at work
only
have
Office 2007? Do you see any modules under the module tab in your
database?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is so much code, I was trying to narrow down what you would
need
to
see. There are gosubs and user defined functions, so I hope I
didn't
miss
anything. The first time the button is clicked, another field
combo
box
appears for the user to select a word doc that they want to use.
when
the
user clicks the button again it creates a merge file of the
displayed
person
and the Word doc opens with the data merged in. First I pasted
the
important
called function. Note that there are commented out lines in
here,
too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM",
Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers",
"[UserID]
=
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases Qry"
table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode As
String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String,
Judgeinitstring
As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form ID]
=
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table",
"[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table", "[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control
Table",
"[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL
Form
id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL
Form
id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc
subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:
 
G

Gina Whipp

I understand Access 2003 databse in Access 2007 but with Word 2007.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
Just to clarify, we are running Access2007, but in compatability mode. We
are not converting the database to 2007.

Gina Whipp said:
I am going to run some tests... because now my thinking is Access 2003
and
Word 2007 don't play nice together and that is why nothing we are doing
is
working.

Not giving up... on a mission now :cool:
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

KADL said:
Yes. The users all were upgraded to the Office 2007 suite this week.
They
run Word (and the other suite apps) locally and the path in the table
is
correct. The only thing different from last week is that the Office
suite
is
now in an Office12 folder instead of an Office11 folder for the 2003
suite
and I edited the data replacing the "11" with "12".

Thanks for staying with me, Gina.


:

Is Word loaded locally for each User? Did you verify that that path
to
Office 12 is what is located in the table?

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

Darn! Users are still getting either a "Path Not Found" or a "File
Not
Found"
error.

I didn't touch the wpdirectory field of the table "Probation
Officers"
(which tells where the Word doc can be found). The data is an
intranet
path
that didn't change and that worked under 2003.

The msword field has a path in quotation marks ("c:\program files\
etc.)
I
changed only the 11 (Office11) to a 12 (Office12).

I verified both paths as matching what is on the user's machine. She
also
verified that there is no longer an Office11 folder.

Luckily I was able to give the user's a workaround since the command
button
does correctly create the merge file. They can open the desired
Word
doc
manually.

Could Access 2007 running in compatibility mode be reading those
paths
differently than 2003 does? One has the \\path and the other has
the
"C:\.."
path

Any other ideas before I tell them they have to live with the
inconvenience
of the workaround?

Thanks,
KADL

:

Hopefully, that works... Let us know!

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

With your "path to Word" talk I got to thinking. I found a table
that
had
each user's path to winword.exe!

I'm going to update the data and I'm confident it will work.

Thanks!

KADL

:

Krisse,

Not alot of code at all...

From what I can tell, somewhere in this application the path to
Word
is
set
and it's looking for WOrd in a specific folder. And since it's
not
in
this
bit of code it must be somewhere else. Do the machines at work
only
have
Office 2007? Do you see any modules under the module tab in
your
database?

--
Gina Whipp

"I feel I have been denied critical, need to know,
information!" -
Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

There is so much code, I was trying to narrow down what you
would
need
to
see. There are gosubs and user defined functions, so I hope I
didn't
miss
anything. The first time the button is clicked, another field
combo
box
appears for the user to select a word doc that they want to
use.
when
the
user clicks the button again it creates a merge file of the
displayed
person
and the Word doc opens with the data merged in. First I
pasted
the
important
called function. Note that there are commented out lines in
here,
too.

Thank you so much for your help!

Function get_Cur_Pbomsword()
Dim xstring As String

On Error GoTo err_get_cur_Pbomsword
get_Cur_Pbomsword = GetSetting(appname:="ICM",
Section:="mswordname",
Key:="appname", Default:="25")
If get_Cur_Pbomsword = "25" Then
xstring = DLookup("[msword]", "Probation Officers",
"[UserID]
=
CurrentUser()")
SaveSetting "ICM", "mswordname", "appname", xstring
get_Cur_Pbomsword = xstring
End If

exit_get_Cur_Pbomsword:
Exit Function

err_get_cur_Pbomsword:
get_Cur_Pbomsword = "err"
GoTo exit_get_Cur_Pbomsword
End Function


Private Sub PrintLetter_Click()
On Error GoTo Err_PrintLetter_Click

Dim inset As Recordset ' inset = "Defendant Cases
Qry"
table
Dim db As Database
Dim inCriteria As String
Dim x As Variant, stuff As String, Pbo_DefaultPrinterMode
As
String
Dim DocName As String, DocType As String
Dim casestring As String, Courtstring As String,
Judgeinitstring
As
String
Dim Access_form As String
Const Corr_Letter = "Corr - Letter"
Dim Deftid As Long, CHCCID As Long, Court As String
Dim LinkCriteria As String
Dim Note As String, Trancode As String
Dim crlf As String
Dim Word_command As String, wpdir As String
Dim MyControl As Control
Dim writestat As Integer, writefilenote As Integer
Dim comma As String
Dim qt As String

qt = Chr$(34)
crlf = Chr$(13) & Chr$(10)
If Me![FAL Form id].Visible = False Then
Me![FAL Form id].Visible = True
Set MyControl = Me![FAL Form id]
MyControl.SetFocus
GoTo exit_PrintLetter_Click
End If

Me![PrintLetter].SetFocus
Me![FAL Form id].Visible = False
If IsNull(Me![FAL Form id]) Then
MsgBox "Must select a form or letter first"
GoTo exit_PrintLetter_Click
End If
Access_form = "???"
Set db = CurrentDb()

On Error GoTo PrintLetter_Click_cont1
DocType = DLookup("[DocType]", "FAL Control Table", "[Form
ID]
=
Forms![Defendant Lookup Form]![FAL Form id]")

On Error GoTo Err_PrintLetter_Click
If DocType = "L" Then
GoSub Link_to_word
Else
GoSub Print_Report
End If

exit_PrintLetter_Click:
Set db = Nothing
DoCmd.SetWarnings True
Exit Sub

Err_PrintLetter_Click:
MsgBox Error$
Resume exit_PrintLetter_Click

PrintLetter_Click_cont1:
GoSub Link_to_word
GoTo exit_PrintLetter_Click

Print_Report:
Access_form = DLookup("[AccessForm]", "FAL Control Table",
"[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writestat = DLookup("[WriteStat]", "FAL Control Table",
"[Form
ID] =
Forms![Defendant Lookup Form]![FAL Form id]")
writefilenote = DLookup("[WriteFilenote]", "FAL Control
Table",
"[Form
ID] = Forms![Defendant Lookup Form]![FAL Form id]")
If Access_form <> "not" Then
DoCmd.OpenForm Access_form, , , LinkCriteria
Else
Pbo_DefaultPrinterMode = get_Pbo_PrintPreview()
If get_Pbo_PrintPreview() Then
DoCmd.OpenReport Forms![defendant lookup form]![FAL
Form
id],
A_PREVIEW
Else
DoCmd.OpenReport Forms![defendant lookup form]![FAL
Form
id],
A_NORMAL
End If
' add stat
DoEvents
If writestat Then
Deftid = Forms![defendant lookup form]![Deftid]
CHCCID = Forms![defendant lookup form]![chcc
subform].Form![CHCCID]
Court = Forms![defendant lookup form]![chcc
subform].Form![Court]
' X = Add_Stat(Corr_Letter, Deftid, CHCCid, Court)
End If
' add file note
If writefilenote Then
Note = ""
Trancode = "LC"
x = Add_Note(Deftid, CHCCID, Note, Trancode)
End If
End If

Print_Report_Exit:
Return

Link_to_word:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top