the selected item (each),from combo box list,should open different forms

Re: word document file should be opened from combo list

You've written the code and what happens? An error? It doesn't work?
 
Re: combo list box - click- open-word.doc

This would have to be:

LWordDoc = "D:\PROJECT ACCESS DOC\tense tab\" & ComboValue & ".doc"

I don't know if the inadvisable spaces will cause a problem.
 
Re: ms-word document file from the combo box

Well that's confusing :confused:I'm outa here :rolleyes:
 
Re: word document file should be opened from combo list

hi,
it gives me the err
run time err 490
can not open the specified file

this is the code in text box click event, ok.

Private Sub Text55_Click()
Application.FollowHyperlink Nz(Text55, "")
End Sub
 
Re: word document file should be opened from combo list

Show me an example of the full path.
 
Re: word document file should be opened from combo list

full path is: D:\PROJECT ACCESS DOC\tense tab\tenses 1-25.doc

but there are many (about 50) items should be listed in the combo box list. i already have the word documents to each item in the same name,to identify and open it from the list box easily.

so each item name in the list should open a word file contain the same file name to the item name. (item name 'tenses 1-25' should open, the word file name 'tenses 1-25.doc'... and so on, all the items should open ,to its corresponding file name in the word
 
Re: word document file should be opened from combo list

Attach your db and I will have a look at it. Remove any confidential information of course and remember to ZIP
 
Re: word document file should be opened from combo list

sorry, i don't have zip facility now.
if you need any information about db i will supply it.
thank you
 
Re: word document file should be opened from combo list

Check the file path properly. You must have spelt it incorrectly.

Open My Computer and in the Address Bar paste that path and hit Enter key and see if it opens. It wouldn't because that's the wrong path.
 
Re: combo list box - click- open-word.doc

thank you pbaldy!
it works as code wise and show the msg box information "file not found".

I already have the word documents to each item in the same name, to identify and open it from the list box easily. (full path is: D:\PROJECT ACCESS DOC\tense tab\tenses 1-25.doc)

there are 2 columns in my table ‘tenses names’
1. id
2. tenses name
I want to list the records of the field ‘tenses name’ ,from the table ‘tenses names’ as item in combo list box.
I already have the word documents to each item in the same name( to identify and open it from the list box easily. e.g. D:\PROJECT ACCESS DOC\tense tab\tenses 1-25.doc))
so each item name in the list should open a word file contain the same file name as in the item name. (e.g.: the item name 'tenses 1-25' should open, the word file name 'tenses 1-25.doc'... and so on, all the (about 50) items should open ,to its corresponding file name in the word)
so pls , guide the way to set the properties (record source. record type. control source, column count, bound column require to for my problem ( I have lit bit confusion to set this ) and necessary code to this . thank you for listening my post
 
Re: combo list box - click- open-word.doc

hi, pbaldy

if there there are two columns (first ' id', second 'tenses name') in my table means, i should give 1 as column value, to display the 2nd column, isn't it ?
Then i used a command button to check whether it open the word document or not, again still it gives the same err msg, 'document not found'.
file and path is perfect. what would be cause to this problem.




[FONT=&quot]Private Sub Combo5_Click()
Dim ComboValue As String
Dim LWordDoc As String
Dim oApp As Object

ComboValue = [Combo5].Column(0)
'Path to the word document
LWordDoc = "D:\PROJECT ACCESS DOC\tense tab\"ComboValue".doc"
If Dir(LWordDoc) = "" Then
MsgBox "Document not found."
Else
'Create an instance of MS Word
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
'Open the Document
oApp.Documents.Open LWordDoc
End If

End Sub[/FONT]
 
[FONT=&quot]thank you SoS to reply me.

In access 2007, how can i open a ms-word document file from the combo box list directly, when the item clicked from the combo list box.
In my case the name in the (field) list of the combo box is same as the name of the document.
so when i click from the list it should open the corresponding file name from the ms-word.
[/FONT] if there there are two columns (first ' id', second 'tenses name') in my table means, i should give 1 as column value, to display the 2nd column, isn't it ?



it gives the err msg, 'document not found'.
file and path is perfect. what would be cause to this problem.

the combo property is set to be

column count=2
bound column=1
row source=SELECT [tenses names].ID, [tenses names].[tenses name] FROM [tenses names];





i try this code below.
is my idea wrong or i am nearing?


Private Sub Combo5_Click()
Dim ComboValue As String
Dim LWordDoc As String
Dim oApp As Object

ComboValue = [Combo5].Column(0)
'Path to the word document
LWordDoc = "D:\PROJECT ACCESS DOC\tense tab\"ComboValue".doc"
If Dir(LWordDoc) = "" Then
MsgBox "Document not found."
Else
'Create an instance of MS Word
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
'Open the Document
oApp.Documents.Open LWordDoc
End If

End Sub


 
Use the After Update event of the combo, not the click event.

Also, you should be able to shorten your code down to just this line:

Code:
FollowHyperlink Me.Combo5.Column(1)

It is column 1 because column(0) is the first column and column(1) is the second. And you should also rename your controls to something meaningful instead of leaving them as they were created (Combo5, etc.). That way it is much easier for you and anyone following to figure out what is going on later down the line.

Also, make sure that the COLUMN COUNT for Combo5 is set to 2 instead of 1 otherwise it won't be able to use that value.
 
Re: word document file should be opened from combo list

thanks VbaInet, it's correct. i missed the 'x' from the file extention '.docx' and
i reduced the code to open the file is 'Application.FollowHyperlink Nz(LWordDoc, "")'
otherwise it opens the application(ms-word) only and it doesn't open file.
now it's ok. thank u.
and shall i use ,when i need open the .bmp file and assign the same and only changes is location and file extention? but didn't work. any problem?
 
Re: ms-word document file from the combo box

thanks John big booty, it's correct. i missed the 'x' from the file extention '.docx' and
i reduced the code to open the file is 'Application.FollowHyperlink Nz(LWordDoc, "")'
otherwise it opens the application(ms-word) only and it doesn't open file.
now it's ok. thank u.
and shall i use ,when i need open the .bmp file and assign the same and only changes is location and file extention? but didn't work. any problem?
 
thanks VbaInet, it's correct. i missed the 'x' from the file extention '.docx' and
i reduced the code to open the file is 'Application.FollowHyperlink Nz(LWordDoc, "")'
otherwise it opens the application(ms-word) only and it doesn't open file.
now it's ok. thank u.
and shall i use ,when i need open the .bmp file and assign the same and only changes is location and file extention? but didn't work. any problem?
 

Users who are viewing this thread

Back
Top Bottom