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

thangasiva

Registered User.
Local time
Tomorrow, 02:23
Joined
Apr 12, 2007
Messages
33
hi experts!
this is my problem,
the name of the forms in a project should be listed in a combo box, and when choose a item from the list should open a corresponding form.
i tried, but it opens the same form to all the items in the list. where did i mistake. pls help me.
 
Can we see the code you're using to open the corresponding form?
 
And what is the SQL for your combo's row source? Also, what is the bound column number set to, as well as the COLUMN COUNT property?
 
hi,i did it by macro builder,
but it opens the same form. how can i use it for different forms?
code pls.
thank u
 
Convert the macro to vba code then paste it here so we can see.
 
word document file should be opened from combo list

[FONT=&quot]hi experts

[/FONT]In access 2010, how can i open a ms-word document file from the combo box list directly, when the item chosen from the list.
In my case the the name of the (field) list name 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,to the list name accordingly. thank you
 
Last edited:
Re: word document file should be opened from combo list

You need another field which will be the full path to the document.
 
Re: word document file should be opened from combo list

sorry,
i don't understand, pls i need detailed answer, i am learning access now.
 
Re: word document file should be opened from combo list

Full path example:

C:\Users\Administrator\Desktop\MyWordDocument.doc

A text field to hold that text for each document.
 
Re: word document file should be opened from combo list

again sorry,
because I think that I am new to this access and I am difficult to absorb the way you guiding me.
i already created the combo list by wizard using ‘I will type in the values that I want’.
so pls guide me where to create another field, or shall need to create table as second column with the full path field?.
how to write the code (pls give me the code with explain,if possible) to match these corresponding fields to open the word documents.
I think it will be lengthy. sorry,
thank you.
 
Re: word document file should be opened from combo list

Create another field in your table and make the datatype Text.
 
Re: word document file should be opened from combo list

ok, i created another field in my table and make the datatype Text, to the full path of the word document.
 
ms-word document file from the combo box

[FONT=&quot]hi ,this will be simple or hard i don't know.

[/FONT]In access 2007, how can i open a ms-word document file from the combo box list directly, when the item chosen from the combo list box.
In my case the name in the (field) list 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, pls code guidance
thank you.
 
Re: ms-word document file from the combo box

Perhaps this link will point you in the correct direction.
 
Re: ms-word document file from the combo box

it's cool. i understood the idea to open the word document by command button.
but i have to open from combo box list which contain number of items.
and i have to choose a item from it and then it should open the corresponding word file directly when i click on it .i already have a table in record names are same as in word file names what i want to open . i think i am not confusing you,OK.
 
Re: word document file should be opened from combo list

Great!

The next thing you do is to test it

1. Add that field to your FORM.
2. Go to the PROPERTIES of the textbox, click EVENT tab, put your cursor inside the CLICK event, click the button (...) that appears, select EVENT PROCEDURE and OK
3. Inside there you will write:
Code:
Application.FollowHyperlink Nz([COLOR=Red][B]TheNameofTextboxHere[/B][/COLOR], "")

Go back, run your form and click the textbox.
 
Re: ms-word document file from the combo box

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



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
 
Re: word document file should be opened from combo list

really sorry,
how can i add that field to that form
 
Re: word document file should be opened from combo list

but i wrote that code to the textbox click event
 
combo list box - click- open-word.doc

hi ,this will be simple or hard i don't know.[FONT=&quot]

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, pls code guidance

[/FONT]
[FONT=&quot]i try this code below.
is my idea wrong or i am nearing?
help me.

[/FONT]thank you.
[FONT=&quot]

Private Sub Combo5_Click()
Dim ComboValue As String
Dim LWordDoc As String
Dim oApp As Object[/FONT]
[FONT=&quot]
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]
 

Users who are viewing this thread

Back
Top Bottom