UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Populate textbox based on values of two comboboxes    
 
   
TechSteff
post Nov 5 2010, 12:46 PM
Post #1

UtterAccess Member
Posts: 32



Hello there!

(IMG:style_emoticons/default/iconfused.gif) I have a question...how can I populate a texbox on a form based on the choice of two comboboxes? So far I have done this using only combo boxes, but I want it to populate in a textbox. Any help would be greatly appreciated,

Thanks in advance

~TechSteff

This post has been edited by TechSteff: Nov 5 2010, 12:49 PM
Go to the top of the page
 
+
Bob G
post Nov 5 2010, 12:57 PM
Post #2

UtterAccess VIP
Posts: 8,138
From: CT



so, you have an unbound textbox that you want to take information from 2 different comboboxes. what I would suggest is actually using 3 textboxes even if you have to hide them. Reason being if you use 1 and you concatenate the combobox1 value and combobox2 value when would you do this in code? After Combo2 onclick? how would you check if combo1 had been done already. With a textbox for each you can check to make sure they are both not empty and then your third textbox would simply be text3 = text1 & text2 you can put in spaces or commas or semi colons or......

Just my thoughts
Go to the top of the page
 
+
Alan_G
post Nov 5 2010, 01:01 PM
Post #3

Utterly Yorkshire and Forum/Wiki Editor
Posts: 15,884
From: Devon UK



Hi

You're question is a bit vague (IMG:style_emoticons/default/iconfused.gif)

Could do with more details from you as to exactly what you want for someone to be able to give you an answer (IMG:style_emoticons/default/wink.gif)
Go to the top of the page
 
+
TechSteff
post Nov 5 2010, 01:05 PM
Post #4

UtterAccess Member
Posts: 32



Thanks for the reply, but I didn't explan the situation well enough. I have two combo boxes and based on the value of two combo boxes I would like to a query to populate the textbox, for example if Combo1. is Lastname and Combo 2 is Name I want a query to populate the textbox with that persons birthdate something like that...
Go to the top of the page
 
+
Bob G
post Nov 5 2010, 01:42 PM
Post #5

UtterAccess VIP
Posts: 8,138
From: CT



just to clarify..

Your query would look like this very generic example. and have that as the source for your text box ??

select fields from table where fieldlast = forms!combobox1 and fieldother = forms!combox2'


IF yes, could you tell us the name of the table and the name of the fields ?
Go to the top of the page
 
+
theDBguy
post Nov 5 2010, 01:48 PM
Post #6

Access Wiki and Forums Moderator
Posts: 48,019
From: SoCal, USA



Hi,

QUOTE (TechSteff @ Nov 5 2010, 11:05 AM) *
Thanks for the reply, but I didn't explan the situation well enough. I have two combo boxes and based on the value of two combo boxes I would like to a query to populate the textbox, for example if Combo1. is Lastname and Combo 2 is Name I want a query to populate the textbox with that persons birthdate something like that...

Pardon me for jumping in but that description could still use a little more detail. In fact, it's quite possible that we might recommend you to change your form's design. For example, let's say that the first combobox is showing "Smith" and the second combobox is showing "John." What if you actually have more than one "John Smith" in your database? Who's birthday would you want to show up in the textbox?

Just my 2 cents...

EDIT: I guess the point I am trying to make here is that we need to get you into the habit of using Primary Keys. They are the only way to ensure we are working on a specific record.

Cheers

This post has been edited by theDBguy: Nov 5 2010, 01:52 PM
Go to the top of the page
 
+
TechSteff
post Nov 5 2010, 01:57 PM
Post #7

UtterAccess Member
Posts: 32



Thanks for your input guys, but I think I figured it out. (IMG:style_emoticons/default/thanks.gif)
Go to the top of the page
 
+
theDBguy
post Nov 5 2010, 02:03 PM
Post #8

Access Wiki and Forums Moderator
Posts: 48,019
From: SoCal, USA



Hi,

QUOTE (TechSteff @ Nov 5 2010, 11:57 AM) *
Thanks for your input guys, but I think I figured it out. (IMG:style_emoticons/default/thanks.gif)

I hope you are not just saying that. If you truly found a solution, we are happy for you.

I was not trying to scare you away, so I apologize if my post was taken that way.

We wish you the best with your project.

Cheers (IMG:style_emoticons/default/cheers.gif)
Go to the top of the page
 
+
TechSteff
post Nov 5 2010, 02:16 PM
Post #9

UtterAccess Member
Posts: 32



Hahahaha No I figured using a combobox could get the job done ;-)
Go to the top of the page
 
+
theDBguy
post Nov 5 2010, 02:22 PM
Post #10

Access Wiki and Forums Moderator
Posts: 48,019
From: SoCal, USA



Thank you! (IMG:style_emoticons/default/thumbup.gif)
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 10:28 PM