Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 09-10-2019, 09:51 AM   #1
plantgeek
Newly Registered User
 
Join Date: Sep 2019
Posts: 9
Thanks: 11
Thanked 0 Times in 0 Posts
plantgeek is on a distinguished road
Question Checkbox to activate Combo box to then populate textbox - Possible at all? Pls Help

Hello there,

First off, this is my first post (aside from the introductions page) and I could use some guidance.
I am new to vba coding and have no idea what I am doing.
I am working on a costing db and am trying to add an exchange rate option to a costing form.

The Goal:
Is to have a checkbox entitled "Exchange" to select whether the user will be applying an exchange rate.

Next, if the user clicks on the checkbox, it activates a combo box that offers a "USD to CAN" or "CAN to USD" exchange option (These exchange options are being pulled from an exchange rate table).

When an exchange rate is selected from the Combo box , it should populate the text box with the corresponding exchange rate.

I have included a sample zip file of the exchange rate table along with the form with the three elements, but I cannot figure out how to get them to work in the order I want and how to get the exchange rate to populate the text box.

I would like to learn where to start and what best practice is. Please bear in mind I am a complete newb. I appreciate any help or insights on where I can begin to tackle this.

Please let me know if you have any questions.
Attached Files
File Type: zip ExchangeRateSample.zip (42.1 KB, 6 views)

plantgeek is offline   Reply With Quote
Old 09-10-2019, 10:24 AM   #2
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

here is your sample.
Attached Files
File Type: zip ExchangeRateSample.zip (31.8 KB, 2 views)
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 09-10-2019, 10:37 AM   #3
plantgeek
Newly Registered User
 
Join Date: Sep 2019
Posts: 9
Thanks: 11
Thanked 0 Times in 0 Posts
plantgeek is on a distinguished road
Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

I appreciate your time - thank you.

What I am trying to do is ensure that the user is able to click on the exchange option check box and populate the exchange (which is what it is currently doing), but if they decide to change it they can opt to click off. When I try to click the box after the initial click, it unfortunately will not allow me to edit the check box.

I apologize if I didn't state that when I should have.

plantgeek is offline   Reply With Quote
Old 09-10-2019, 10:50 AM   #4
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

the checkbox is in Triple state, that is why you cannot edit it.
(see checkbox's property->data->triple state). I already set it to No.
Attached Files
File Type: zip ExchangeRateSample.zip (32.1 KB, 6 views)
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
plantgeek (09-12-2019)
Old 09-12-2019, 05:58 AM   #5
plantgeek
Newly Registered User
 
Join Date: Sep 2019
Posts: 9
Thanks: 11
Thanked 0 Times in 0 Posts
plantgeek is on a distinguished road
Unhappy Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

Hello arnelgp, thank you. Sorry for the delay, it has been crazy these past couple of days at work and have not had an opportunity to pop back in here.

First off, thank you for taking the time to help me, I do appreciate it.

Unfortunately, when I click the check box to activate the exchange cbo box, the cbo box is deactivated (grayed out).

What I would like is to understand where I am going wrong in my first application.

Second, this sample was only to show what I'd like to do, but will be adding this function to a larger costing database that currently needs the exchange rate option.

Would you be able to guide me to help me understand what I am doing wrong in my sample?
plantgeek is offline   Reply With Quote
Old 09-12-2019, 06:22 AM   #6
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

are you referring to the one I upload?
I just tested it, if checked combo is activated.
if unchecked, deactivated.

on design view of your form, click on the checkbox.
on it's property sheet->Data->triple state: No.
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
plantgeek (09-12-2019)
Old 09-12-2019, 06:31 AM   #7
plantgeek
Newly Registered User
 
Join Date: Sep 2019
Posts: 9
Thanks: 11
Thanked 0 Times in 0 Posts
plantgeek is on a distinguished road
Smile Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

Hello arnelgp, I apologize! I had the previous sample and hadn't downloaded the new one. Thank you for your help I will check out the code to see how you have handled this.

I appreciate your help!

plantgeek is offline   Reply With Quote
Old 09-12-2019, 06:35 AM   #8
arnelgp
error reading drive A:
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 8,569
Thanks: 68
Thanked 2,745 Times in 2,630 Posts
arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice arnelgp is just really nice
Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

goodluck and comeback anytime!
__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
The Following User Says Thank You to arnelgp For This Useful Post:
plantgeek (09-12-2019)
Old 09-12-2019, 09:05 AM   #9
Mark_
Longboard on the internet
 
Join Date: Sep 2017
Location: Not the middle of no where, but I can see the road to it from my house.
Posts: 2,112
Thanks: 20
Thanked 400 Times in 393 Posts
Mark_ will become famous soon enough Mark_ will become famous soon enough
Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

From a design standpoint, I'll admit I'd do this a little differently.

I'd have your combo for exchange rates. I'd have the default for it be "", and "" would be an option. Then if you DON'T have a value in the combo, you know your NOT using an exchange rate. Otherwise you know which one you are using. This means your not using two different fields to store the same data.

In all cases where you'd need to use the exchange rate, you'd be looking at the value you've selected in the combo box, so you'd never be looking for the check box. In all cases where you won't use an exchange rate, you'd be looking at the value in teh combo box to be "", so you'd never be looking at the check box.
Mark_ is offline   Reply With Quote
The Following User Says Thank You to Mark_ For This Useful Post:
plantgeek (09-18-2019)
Old 09-12-2019, 11:37 AM   #10
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,298
Thanks: 15
Thanked 1,597 Times in 1,517 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

Just FYI - "" is a ZLS (Zero Length STRING) and is ONLY valid for text fields. If the combo is bound to a numeric field, "" would be invalid.
__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
The Following User Says Thank You to Pat Hartman For This Useful Post:
plantgeek (09-18-2019)
Old 09-12-2019, 05:12 PM   #11
Micron
AWF VIP
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 1,186
Thanks: 10
Thanked 226 Times in 214 Posts
Micron has a spectacular aura about Micron has a spectacular aura about
Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

My first thought as I read was also to do away with the checkbox as it just adds an unnecessary layer of complexity, so nice call, Mark. Perhaps the only difference is that I was thinking of (none) as the first combo option for exchange rates. However, text is not an invalid value for a combo bound to a numeric field because the text field would be the 2nd column, not the bound column.
__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
The Following User Says Thank You to Micron For This Useful Post:
plantgeek (09-18-2019)
Old 09-13-2019, 07:32 AM   #12
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 28,298
Thanks: 15
Thanked 1,597 Times in 1,517 Posts
Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all Pat Hartman is a name known to all
Re: Checkbox to activate Combo box to then populate textbox - Possible at all? Pls He

"None" is a much better choice. Having the combo be empty just looks like nothing was chosen but maybe it should have been.
__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
The Following User Says Thank You to Pat Hartman For This Useful Post:
plantgeek (09-18-2019)
Old 09-18-2019, 04:50 AM   #13
plantgeek
Newly Registered User
 
Join Date: Sep 2019
Posts: 9
Thanks: 11
Thanked 0 Times in 0 Posts
plantgeek is on a distinguished road
Again, I am sorry for the delay. I do appreciate all your feedback! There is so much I don't know yet in terms of thinking about complexity, memory limits etc, and as I keep going I find I encounter different problems that I have to figure out lol.
I have since gone with the drop down and the exchange is working well with the costing database I have on the go.
I will certainly, take these other suggestions and keep them in mind for future applications.
plantgeek is offline   Reply With Quote
Old 09-18-2019, 04:51 AM   #14
plantgeek
Newly Registered User
 
Join Date: Sep 2019
Posts: 9
Thanks: 11
Thanked 0 Times in 0 Posts
plantgeek is on a distinguished road
Smile Thank you

Again, I am sorry for the delay. I do appreciate all your feedback! There is so much I don't know yet in terms of thinking about complexity, memory limits etc, and as I keep going I find I encounter different problems that I have to figure out lol.
I have since gone with the drop down and the exchange is working well with the costing database I have on the go.
I will certainly, take these other suggestions and keep them in mind for future applications.

plantgeek is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to populate a textbox with ONLY the first Combo Box selection when selecting 2 va SashaSolo Modules & VBA 21 10-24-2018 03:51 PM
Select record in combo and populate textbox thmsjlmnt3953 Forms 4 09-19-2014 12:03 PM
Populate Textbox from Value in Combo. Lensmeister Forms 2 10-02-2009 04:25 AM
Populate TextBox with Combo Box Selection Court Forms 3 03-03-2009 10:47 AM
Populate textbox with a field from another combo box's row/source table Bada bing! Forms 11 12-24-2006 01:23 PM




All times are GMT -8. The time now is 10:23 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World