473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Open file based on combobox selection

I'm working on an Access database and have a form with a combo box (a list of assembly plant locations), and I want a command button that will open the layout file for that plant.

I've got
Application.FollowHyperlink "<file location>"
which works, but I'm looking for a way to control what file is opened based on the selection in the combobox.
I tried
If ([Combo154]="<plant name1> Then
Else
If ([Combo154]="<plant name1> Then


Etc...

I also tried

If Combo154.Text.Contains("<Plant name>" Then

Etc

However both of those just made the command button do nothing (didn't even return error code)

Any suggestions?
Jan 30 '08 #1
3 2605
Killer42
8,435 Expert 8TB
My first suggestion would be to put a break point in the code, run it, stop and display the values that the code is working with. Then you can determine why your IF isn't working as expected.

Get to know the VB debugging tools, they can be your best friend at a time like this.
Jan 30 '08 #2
How would I do that? I'm new to VB, mostly let access create my code for me, and then just tweak it to do what I want. This project is my first real exposure to it.
Jan 31 '08 #3
Killer42
8,435 Expert 8TB
How would I do that? I'm new to VB, mostly let access create my code for me, and then just tweak it to do what I want. This project is my first real exposure to it.
Oh. Hope you're having fun, then.

Just put your cursor on the line where you want to interrupt execution, and hit F9. That should do a red highlight to show there's a breakpoint there. Then, when the code is executing and reaches that line, it will pause (before executing it)and wait for you to tell it what to do.

Using the tools available on the Debug toolbar (also on the Debug menu), you can then view or modify variable values, execute one statement at a time, and so on. Have a look through the documentation for the debugging tools, as they are invaluable for this sort of stuff.
Jan 31 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Steve | last post by:
I have an unbound combobox in the form header of a continuous form. The selection in the combobox sets the where clause in a querydef which determines QryPFrmInventoryManagement. The following code...
4
by: Sue Bricker | last post by:
Greetings. In Access, is there a way to open up a drop-down combobox with keys on the keyboard, instead of using the mouse to click on the down arrow of the combobox? I really prefer to use the...
3
by: Eagle | last post by:
Hi, I've got an input form (frmInput) that can be accessed in two ways. A combobox on this form either gets filled in by a selection on an already opened form (frmBasic), or one can input a...
7
by: grummanf6f | last post by:
Hello Gurus, this probably is real simple for you but for me it's a bummer. I have one table in which I have basic data collected of schools. I have another data that is detailed info on the...
5
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
0
by: CCLeasing | last post by:
Hello, I have searched google but can not find a straight forward answer to my problem. Hopefuly someone will be kind enough to offer their expertise. Please forgive if this seems a bit convoluted...
2
by: Randy | last post by:
Hi, I'm trying to populate textbox values upon a change in a combobox selection. I'm using the Publishers table in the Pubs sample database as a simplified example. Here is the code: Private...
2
by: jujubean | last post by:
I have a form with five comboboxes. In the first, the user can select one of four items. The other four comboxes are hidden. Based on the selection made in combobox one, I would like one of the...
2
by: billypit | last post by:
Hi, I have one form in which I have one combobox and one subform. now when I am selecting value from combobox it will show details in subform by filtering from table based on my selection of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.