Please Help??? Filtering using combo boxes....

G

Guest

I have a number of records each of which has fields entitled Work Station
and Work Instruction. The Work Instruction field is individual to each
record, whereas the Work Station could be the same for any number of records.

I have successfully created a combo box in a form to filter out all Work
Instructions for different Work Stations. I have done this using the example:

http://www.databasedev.co.uk/filter_combo_boxes.html

Problem is that I want to use whats in the Combo boxes to open a hyperlink
from a Command Button, like so:

Private Sub ViewWI_Click()
On Error GoTo ErrHandler

Me.ViewWI.HyperlinkAddress = ""

Me.ViewWI.HyperlinkAddress = "\\Mercury\Users\Trim Line Work
Instructions 2006\" & _
Me.SelectWorkStation & "\" & Me.WorkInstruction & ".doc"

Exit Sub

Where 'SelectWorkStation' and 'WorkInstruction' are the Combo Boxes. This
doesn't work because 'SelectWorkStation' uses a number ID whereas it displays
a title refer to example database.
For Example, hyperlink is: //Trim Line/1/Bump Stops.doc
Hyperlink should be: //Trim Line/GU010 Body Fit 1/Bump Stops.doc

My question therefore is how do I force the number to refer to the station
instead?????
Thanks in advance
 
O

OfficeDev18 via AccessMonster.com

give the SelectWorkStation combo box a second column, which can be the text
you need and can be hidden from the user by giving it a width of 0". When you
define your hyperlink address, simply change

Me.SelectWorkStation

to

Me.SelectWorkStation.Column(2)

to retrieve the text instead of the number. Of course, you can do the same
with the WorkInstruction if necessary.

Hope This Helps.
 
G

Guest

Ok, sounds good but.... the text I want is already in the combo box but when
used in VB as a "Me.command" the workstation Id (i.e 3 for Station 3) is
shown instead of the text in the combo box.

Can I change this????
 

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