Combo Box Selection Enables Field

emilyebba

Registered User.
Local time
Today, 11:22
Joined
Sep 26, 2012
Messages
76
Hi,

I have a bound combo box for payments. You can either pay by cash, check, or charge. If you select Check in the combo box I would like another field (CheckNum) to become enabled.

My Combo Box name is: combo_PaybyType
Check field is: CheckNum (I have this set to disabled)

Thanks!
 
Sorry but I have to say "REALLY???" After all we went through to enable the extra fields from the checkbox and you've learned nothing from that? You should be able to do this by now. I don't know, but it really is starting to sound like you just want others to write the code for you and you not to actually think about it.

headinhands.jpg
 
Wow I think that is unnecessarily harsh. Im trying my best to learn and understand how this all works and your comment is discouraging. Ive never worked with combo box selections. The past post you helped me on was a checkbox.to enable a field. Im sorry that I am not proficient enough for you in Access but I thought that was what this forum was about.
 
Wow I think that is unnecessarily harsh.
I don't think so.
The past post you helped me on was a checkbox.to enable a field. Im sorry that I am not proficient enough for you in Access but I thought that was what this forum was about.
Some common sense would be good. If you are enabling controls based on a selection, the same concepts would apply to this one.

Checkbox - After Update and Form's Current Event

Combobox - After Update and Form's Current Event

Code - almost identical with a few changes that should be quite evident based on where we are going. But as I said before - you don't seem to be trying. Where is the code you have TRIED to get it to work and can't? You didn't post any. You basically just asked for a solution. That is why I said what I said and I stand by it.

Yes, the forum is to help people. But people also need to use their gray matter a bit and THINK before they just go off and post ESPECIALLY when it is a very similar thing they just got help with - Enable/Disable controls based on a selection. Can you understand why I am a little perturbed?
 
Before I posted I searched this forum for help and found this post: http://www.access-programmers.co.uk/forums/showthread.php?t=128059 and this was the code I tried:

Private Sub combo_PaybyType_AfterUpdate()

Select Case Me.combo_PaybyType.Value
Case "Check"
'Enable CheckNum controls here
End Select

It didnt work and that is when I made my post that frustrated you. Im doing my best and trying to learn this new language of programming. Its quite challenging for a novice and not intuitive at all for me. Thank you for your help.
 
So, that helps. Make sure that the combo box's value (the bound column) is returning exactly what you think it is. So, add a message box to the after update event like this:

Msgbox Me.combo_PaybyType

to see what value pops up when you select something. It could be that there is an ID that pops up instead of the text that is being displayed. And if that is the case you can just change your code to

Select Case Me.combo_PaybyType.Column(1)

(which would be the second column since combo's are 'zero based')
 
[FONT=&quot]Mr. Larson I tried at length to modify the code and found it not working. So I thought to use the same methodology as the checkbox and try, as you suggested, something close to that (since I understand that and how it works). This is what I came up with and its not working. Am I getting close?

Private Sub combo_PaybyType_AfterUpdate()

Me.PayByType "Check" = Me.CheckNum.Enabled

Thank you.[/FONT]
 
No it is backwards.

Me.CheckNumEnabled = (Me.PayByType = "Check")
 

Users who are viewing this thread

Back
Top Bottom