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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems r us- opening word docs, reports from crosstabs and

Status
Not open for further replies.

rhintintin

Technical User
Jan 31, 2001
12
GB
i need help with the following problems please

1) I am trying to make a macro to open a word file from access, i have used the runapp and the command line

drive:/dir/dir/winword.exe -drive:/dir/letter.doc

i have tried numberous variations on this and none work can some one help me

2) i have made a report from a cross tab, however if when i make the crosstab one of the cross tab fields is empty (does not appear on the query) it cant be added to the report, if data is then added to the table, that means this crosstab now has data in it does not appear on the report.
I tried to make the report with the crosstab having data in each field, but then if the field is emptied then the report does not work with the following error coming up 'The microsoft jet database does not recognise '[field name]' as a valid field name or expression'.
 
I have done this with code (from a button click on a form) instead of a macro, so if you really want to have a macro, you could modify this code and call it from the macro:
Code:
Private Sub btnRun_Click()
On Error GoTo Err_btnRun_Click
    Dim stAppName As String
    stAppName = "word.exe " & """" & Me!cboWord.Value & """"
    Call Shell(stAppName, 1)
Exit_btnRun_Click:
    Exit Sub
Err_btnRun_Click:
    MsgBox Err.Description
    Resume Exit_btnRun_Click
End Sub
This form had a combobox that allowed the user to select which document to open. Make sure that you fill in the complete path to MS Word.

Hope this helps...


Terry M. Hoey
th3856@txmail.sbc.com

Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top