473,322 Members | 1,671 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,322 software developers and data experts.

populate textbox from two combo boxes

12
Hello,

If i have a table like this:

U I AbsTime TypeOfFile
2 0.01 0000001 000001-D00
3 0.01 0000002 000001-D00
4 0.01 0000003 000002-D00
7 0.02 0000004 000003-D00
5 0.03 0000005 000001-D04
6 0.01 0000006 000002-D04

And i have made two combo boxes (on a form) where you can select one of the fields; either U,I,AbsTIme or TypeOfFile. And the other combo box where i have added the parameters D00,D01,D02,D03,D04.

How do i populate a listbox based on the selections from the two combo boxes?

i.e if i choose combo1 = U and combo2 = D00 i want the textbox to be populated with:

000001-D00
000002-D00
000003-D00

Where 000001-D00 corresponds to U = 2 and 3; and 000002-D00 corresponds to U = 4; and 000003-D00 corresponds to U=7.

Thanks a lot



----==== Edit =====----

i have tried something like:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo2_AfterUpdate()
  2.    Me!List12 = Me!Combo2.Column(0)
  3. End Sub
just to try to see how it works. I thought that this code would populate the textbox after selecting a parameter from the combo2. But unfortunatly it doesnt. Guess im missing out on something here.

Cheers
Apr 4 '11 #1

✓ answered by Scorp Scorp

Set you list Data Row source property to Value List.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo24_Click() 
  2. me.list12.additem me.combo24.text 
  3. End Sub 
  4.  

4 1807
You need to populate in a textbox or a listbox ??

To triger the combo selection, u should use on change event:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo24_Click()
  2. me.text12.value = me.combo24.text
  3. End Sub
  4.  
Apr 4 '11 #2
Higgs
12
sorry my mistake, it should be listbox and not textbox.

Thanks
Apr 4 '11 #3
Set you list Data Row source property to Value List.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo24_Click() 
  2. me.list12.additem me.combo24.text 
  3. End Sub 
  4.  
Apr 4 '11 #4
Higgs
12
Thank you,

Thats a good start. As i have progressed and need to ask a new question ill start a new thread to avoid any confusions.

Thanks
Apr 4 '11 #5

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

Similar topics

0
by: Joyce | last post by:
The XML Schema design problem to solve is as follows: We have 2 combo boxes to populate from schema data, let's say: 1. States 2. Cities (and this one gets populated depending on the choice of...
2
by: Derk | last post by:
I have to write a web page wht three combo boxes, all three are to be populated from a database. - there tables = Bulidings, Floors and Offices The user will choose a 'Building' from the first...
0
by: Andrew | last post by:
Hello, I am trying to create a chart whose underlying query is linked to 2 combo boxes on the same form. I want to pass the values from the combo boxes into the chart query to allow the chart...
4
by: rut | last post by:
I have a need to put a combobox in one column of a datagrid. My problem is that I need to be able to have different datasources for each row of comboboxes. Is there anyway to do this Thanks Rut
9
by: Edwinah63 | last post by:
Hi everyone, Please let there be someone out there who can help. I have two BOUND combo boxes on a continuous form, the second being dependent on the first. I have no problem getting the...
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
7
by: Ausclad | last post by:
Ok, ill try again..... It seems fairly simple. I have two combo boxes in a datagrid. The datagrid is bound to a a table in a dataset. The two combo boxes are bound to a single data table...
5
by: debbie | last post by:
I have three combo boxes on a subform. I have tried setting them up so that when the user clicks in the combo box the curser moves to the left. I have searched the posts and can find nothing that...
11
by: jgoodnight | last post by:
Hi, I have a form with three combo boxes: Area, Sub-Area, and Factor. I've set up the Sub-Area combo box to list only those areas that are part of the selected area. I've set up the Factor combo...
10
by: BarbQB | last post by:
Hi all. I working with an existing access DB at my job and have been asked to add some forms and queries. I've been doing well so far, but this last part of the project has got me stuck. My...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.