f



Update combo box when another combo box onchange event


Hi

I'm just trying to use access for the first time. I have used mysql
befor so I know i little about datebases.

I have imported some tables into access and i have some querys too. Now
I want to use one of the query to update a combobox whem I select an
option in anoyher combobox.

I can run the query but how do I get the result into the combobox? And
how do I update it?

If someone will answer

Thanks in advance

*** Sent via Developersdex http://www.developersdex.com ***
0
kalle (4)
3/24/2009 10:00:00 AM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

2 Replies
668 Views

Similar Articles

[PageSpeed] 35

On 24 Mar, 10:00, kalle <ka...@yahoo.com> wrote:
> Hi
>
> I'm just trying to use access for the first time. I have used mysql
> befor so I know i little about datebases.
>
> I have imported some tables into access and i have some querys too. Now
> I want to use one of the query to update a combobox whem I select an
> option in anoyher combobox.
>
> I can run the query but how do I get the result into the combobox? And
> how do I update it?
>
> If someone will answer

You need to use the AfterUpdate or the OnChange event of the first
combo box, use whatever values you need to construct the SQL, and then
set the DataSource of the second combo box.

Edward
0
teddysnips (320)
3/24/2009 2:33:26 PM
kalle wrote:
> 
> Hi
> 
> I'm just trying to use access for the first time. I have used mysql
> befor so I know i little about datebases.
> 
> I have imported some tables into access and i have some querys too. Now
> I want to use one of the query to update a combobox whem I select an
> option in anoyher combobox.
> 
> I can run the query but how do I get the result into the combobox? And
> how do I update it?
> 
> If someone will answer
> 
> Thanks in advance
> 
> *** Sent via Developersdex http://www.developersdex.com ***

What do you mean, how do I get the result into the combobox?

You can follow the wizard to build the combo.  If you pull up a property 
sheet, the major properties I look at are column headings, the column 
count, the colomn widths under the Format tab (play around with the 
various properties).  Under the Data tab you can select the Row Source 
and type.  There are other properties you can get help on.  Then look at 
events.

You can have an unbound or bound column.  A bound col would be 
associated with a field in a table.  Lets say you have a field in a 
table Order called CustomerID.  You might have the rowsource be
	Select CustomerID, CustName From Customers;
as the rowsource.  CustomerID would be be bound to col 1.

Let's say you have a form with CustomerID and a combo to show some data 
for each CustomerID.  The row source might be something like
	Select WhateverTable.FieldList...From WhateverTable Where CustomerID = 
Forms!ThisFormName!CustomerID

Now you have a combo filtered for the CustomerID.  But what happens if 
you move to another customer record?  You'd want to Requery it so it 
refreshes to the new customer record, most likely in the OnCurrent event 
of the form.
	Me.ComboboxName.Requery
and this way it will filter the listings for that specific customer id.

Anyway, I really don't know what your question(s) is/are trying to 
address.  If you could be a bit more specific that would help.


0
oil (4047)
3/24/2009 5:49:22 PM
Reply:

Similar Artilces:

How to reference one combo box from another combo box
Hello, I have an HTML file that contains a form with 2 selection list (combo box). The first combobox 'onchange' function, addColor(),adds a new color to the second combobox. I have half of the function build, but im missing the how to reference one combobox from another combobox. I've tried using the getElementById with no success. This is how the form with the 2 combobox looks like: <form> <select name="cars" size="1" onchange="addColor(???)"> <option value="Volvo">Volvo</option> <option value="...

Combo box dependent on another combo box, text part is blank
Hi, I have a form with several combo boxes, continuous form format, with record source a query off an Item Table. The fields are Category, Subcategory, and Color. I am displaying descriptions, not ID's, so I have to convert the ID's from various lookup tables. The combo boxes work fine except for subcategory, which is dependent on category. Depending on category, the drop-down box for subcategory will display different items. (for example, when Category is Furniture, Subcategory will display drop-down list of 'Dresser, Nightstand, Desk...". Without clicking on the drop...

Changing combo box list based on another combo box selection
I have a continuous form that has one combo box (cbo1) with the selectable values of "Removal" and "Installation". I would like to change another combo box (cbo2) value list based on the selection in cbo1. For example, when the user selects "Removal" from cbo1 I would like the value list of cbo2 to be one set of values and when "Installation" is selected in cbo1 I would like the value list of cbo2 to be a different set of values. Is this possible? Thanks in advance. Troy Lee troy_lee@comcast.net wrote: > I have a continuous form that has one combo box (cbo1) with the > selectable values of "Removal" and "Installation". I would like to > change another combo box (cbo2) value list based on the selection in > cbo1. > > For example, when the user selects "Removal" from cbo1 I would like > the value list of cbo2 to be one set of values and when "Installation" > is selected in cbo1 I would like the value list of cbo2 to be a > different set of values. > > Is this possible? > > Thanks in advance. > > Troy Lee Sometimes cbo2's rowsoure might be "Select fld from table where id = " & cbo1 In this case, in the AfterUpdate event of cbo1 you'd enter Me.cbo2.Requery You might have to change the rowsource in other cases If me.cbo1 = "Install" then Me.cbo2.rowsource = "Select fld from table1" Else Me.cbo2.row...

update a text box using combo box
Hi all, I have 3 unbound combo boxes in my form which basically helps me to filter for values. I need to update a text box which will be stored with the value I receive after filtering with the combo boxes. I know of the column(n) method (derived from the third combo). However if the user does any sort of manipulation in the first or second combo then the value in the text box doesn't change accordingly. Is there any other way to update the text box in a more accurate way. Please help. TIA -- Regards, B Burghew wrote: > Hi all, > > I have 3 unbound combo boxes in my for...

Update Combo Box from a Text Box Help
I am trying to make a combo box dependent on a text box. I cannot get the combo box to pull the related data from the text box. I have been all over this user group & have tried several versions of code to no avail. I would like to display all contact names (in the combo box) related to the customer number in the text box. Here's what I have: Table: TOrdAck Fields: OACustID, OAContact Table: TCust Fields: CustID, CompanyID, CompanyName Note: The OACustID and the CustID establishes the relationship between the two tables. Query: QCust Fields: TOrdAck. OACustID, TOrdAck.OAContact...

access combo box with after update
I've read many posts about this type of problem, and it seems that some of them have been answered but they haven't completely helped me. First, I want to select from a combo box (cboServer) the server name. Then I want a 2nd combo box (cboDB....for the database(s) on that server) to be limited to only the databases on the server i selected in cboServer. (This is quite similar to the State/City cbo example) I have a Database table with the DB name and Server Name fields (and DB type, DB version fields, etc). I have a Server table with a Server Name field (and IP, Mac, location fields, etc.). And for normalization purposes, I have many databases on one server, but not vice versa (each specific database resides only on 1 server, not many). in cboServer, my rowsource type is table/query and the rowsource is: SELECT DISTINCTROW [Server Name] FROM [Server Inventory List]; in cboServer, my afterupdate vb code is: cboDB.RowSource = "Select Database.[DB Name] From [Database] Where Database.[Server Name] = '" & Me.cboServer & "' Order by [DB Name];" I left cboDB's rowsource blank, and the source type is table/query. The interesting part of my problem is this: If I select server X from cboServer and go to cboDB to what should be a list of databases only on the server X...I get blank selection fields. What that means is this: I matched the number of "invisible" databases in cboDB and it is the EXACT number of database...

Fill combo/list box based on previous combo box selection?
I am fairly new to database design and am having some difficulty getting my combo boxes to work as I'd like them to. I would like to create a form with two combo boxes; the first one would select �JobNum' from my master job table and the second would select a �Supt' associated with the selected JobNum. My tables are setup like this: -tblEmp: Emp# (PRIMARY KEY), EmpName, etc. -tblSupt: SuptEmp#, Job# -tblInjury: InjuredEmp#, Job#, Supt#, etc. -tblJob: Job# (PRIMARY KEY), JobName, etc. How can I setup my two combo boxes so that: Combo Box 1 selects Job# from the list of Job#'s? I can get this far, but a can't seem to tackle the AfterUpdate event in order to successfully populate the 2nd combo box. And Combo Box 2 selects an associated Supt#, a list populated from the selection in Combo Box 1? Thanks in advance for any assistance. Nick Nick, If I understand you right, you want to select a Job# and have the second combo box update to show Supt#'s for the selected Job#. This is what I would do. This is done using a form. Since you have the Job# combo box working let's look at the Supt# combo. Create the Supt# combo like normal. Then go to the properties of the Supt# combo and go to the data tab. Then goto row source and click the build button. From here you can add the Job# field from your tblSupt to the design grid and set the criteria to the Job# combo box on your form. This will tell t...

Setting the size of column widths of a combo box through Code and Searching Combo Box
I have a combo box on a form which is based on table tblMachine. On that combo box I have four columns visible MachineNumber, description, location and type. The bound column is the MachineNumber and this is not set to 0 as the machines have its number on which means the user should know the machine number. My problem is if the user doesn't know the number. I have a button which changes the row source of the combo box to order by description, but when the user starts to type the description the relevant record does not come up as machine number is still visible. Is it possible, when I...

Access 2007 combo box change event
Using Access 2007 Windows XP I have a form with, among other things, two combo boxes. The form and both combo boxes are unbound. I have code running in the change event of the first combo box that updates the RowSource property of the second combo box to something like: "SELECT Field2 FROM TableA WHERE Field1 = " & Forms!FormName! FirstComboBox.Value & " ORDER BY Field2 ASC;" A client recently reported a bug in that the data in the second combo box is not loading properly, using Access 2007. This cannot be duplicated in either Access 2000 or 2003. When the form is first opened, if the tab order is used to navigate to the first combo box the code running on the change event shows the Value and Column(0) properties as null, and the expected value for the Text property. Once the second combo box has the focus, the Value, Column(0) and Text properties of the first combo box all contain the expected values. However, if the mouse is used to navigate to the first combo box, the Change event then shows the correct values in all three properties. I'm unable to find any documentation of this behavior here or elsewhere. Is this a bug? A change in the behavior of a combo box? ...

Referencing a toolbar combo box in MS Access
Is there a way to determine the value of a combobox that resides in a toolbar other than using CommandBars.ActionControl? I want a user to be able to change the combobox and be able to refer to the selected value later, not immediately, and without having to set a public variable. This refers to the toolbar when adding a combobox to the toolbar: CommandBars("myToolbarName").Controls.Add(Type:=msoControlComboBox) But what referes to the combobox once it's created? Any help is appreciated. LQ I found a way to do this for anyone who had the same question: '***START CODE*** Dim objBar As CommandBar, objCbo As CommandBarComboBox, myIndex As Integer Set objBar = Application.CommandBars("myToolbarName") Set objCbo = objBar.Controls("myComboName") myIndex = objCbo.ListIndex Set objCbo = Nothing Set objBar = Nothing '***END CODE*** laurenquantrell@hotmail.com (Lauren Quantrell) wrote in message news:<47e5bd72.0309040455.2143a9a2@posting.google.com>... > Is there a way to determine the value of a combobox that resides in a > toolbar other than using CommandBars.ActionControl? I want a user to > be able to change the combobox and be able to refer to the selected > value later, not immediately, and without having to set a public > variable. > This refers to the toolbar when adding a combobox to the toolbar: > CommandBars("myToolbarName").Controls.Add(Type:=msoControlComboBo...

Access 2003 post SP3 hotfix
"Combo box controls and list box controls display no value or incorrect values in Access 2003 after you install Office 2003 Service Pack 3." And a few more problems SP3 introduced. Description of the Access 2003 post-Service Pack 3 hotfix package: December 18, 2007 http://support.microsoft.com/kb/945674 Tony -- Tony Toews, Microsoft Access MVP Please respond only in the newsgroups so that others can read the entire thread of messages. Microsoft Access Links, Hints, Tips & Accounting Systems at http://www.granite.ab.ca/accsmstr.htm Tony's Microsoft Access Blog...

Access Combo Boxes
Hi, I am trying to do a database which will email out a form to users to get their name, service tag of PC, PC Name and what software they have on the PC. The software part is going to be a (multiple entry) sub-form. I have two fields in this (not including primary key), one is a software name field, this is a combo-box which gets data from a seperate software table. The other field is a version field which is also a combo box from a version table. Now what i have done is put the versions of all the software in one table, e.g. for MS Office, the version table will have 2000,2003,2007, then for project it will have 2003 std, 2003 pro, 2007 std, 2007 pro. this is what it looks like: Version Table ID Version 1 2000 2 2003 3 2007 4 2003 std 5 2003 pro 6 2007 std 7 2007 pro 8 ...etc etc The problem that i need help with is if a person chooses Office, i want the combo box to just display the first 3 records of the version table, and if they choose Project then it displays records 4 to 7. How can i do this? Also if you are an Access guru and think this setup is poo, then i would also be open to any other suggestions. Thanks in advance Add another column to the underlying datasource of your combobox. In this column add some value that would be associated with the desired versions ID colx Version 1 a 2000 2 a 2003 3 a 2007 4 b 2003 std 5 b 2003 pro 6 b 2007 std 7 b 2007 pro...

After Update on Combo Box
Hello, I have a form which people use to add customers. One of the fields is "country". Most of the clients are in the UK, but we have the requirement to have it spelt out as United Kingdom. Currently, the country is selected using a combo box which is connected to a query which pulls through the countries from a table. I wanted to use the After Update action so that if someone entered "UK", it would automatically replace it with "United Kingdom". I used this code: If cbo.value = "uk" or "UK" then cbo.value = "United Kingdom" End If It gives error 13, type mismatch. I'm guessing that this means the combo box is using an index value rather than the text value, although there is only one column (i.e. the text value) in the underlying query. Is this what's happening? Can anyone suggest a way to automate the text replacement? Many thanks, Franc. On Mon, 8 Sep 2008 06:02:26 -0700 (PDT), franc sutherland <franc.sutherland@googlemail.com> wrote: No the error is caused by bad syntax. This code will not compile until you rewrite as: If cbo.value = "uk" or cbo.value = "UK" then cbo.value = "United Kingdom" End If Some simpler solutions come to mind, such as: * Change the entry in the Country table from UK to United Kingdom * Have two columns in the table, one for country abbreviation and one for country name. * Have a default value in that field of "United King...

Update of Combo Boxes
I have created a form with combo boxes only. I have also setup a menu within the Action Bars of the form. In A1 process calls M:MENU25. If I choose an option within the combo box and the click on the action bar option and save the options, the combo box last used does not update. It will only update if I use the function keys. It will also update, if I press return through the combo box or click on another field before saving. It seems that combo boxes cannot work if you want to Save and Exit via and action bar unless you use a function key option first. The reason I an using action ba...

How to access a combo box value by providing the selection string from another vi.
Hi, &nbsp; I have a lower level communication vi with a combo box.&nbsp; I'm using the strings&amp;values[] property to initialize the combo box.&nbsp; When I select a string from the dropdown I get the corresponding value but when I pass in the same string from a caller vi I don't get the corresponding value.&nbsp; How can I access the value for the item I'm selecting from outside?? Perhaps you should just use the strings &amp; values property node to them out of the combo box, then search the 1-D array of clusters for the string that matches the one you are looking for, then return the corresponding value.&nbsp; Since it sounds like you are trying to access the control programmatically, use the programmatic features that are available. &nbsp; Maybe I'm mistaken in what you are trying to do, in which case please post some representative VI's. Thanks Ravens Fan, &nbsp; I did what you suggested.&nbsp; Looking at the text string property and&nbsp;searching the array for the correct value pair seems to work.&nbsp;&nbsp;I thought there was an easier way to access the values directly but this works too. What Rob described is exactly the behavior I was observing in my vi.&nbsp; It is good to know this type of information since&nbsp;I'm an experience programmer but new to Labview and I'm not aware of this kind of behavior.&nbsp; Also thanks for the enum tip.&nbsp; It's kind of frus...

value in list box or combo box
i would like to use combobox or list box in a form for data entry do i have to have a table with value in it and the combobox or list box should look in to that table or i type in the values. 'cause when i create a form with text box and change it to combobox the box is empty there are no records in it . On Apr 12, 10:29 am, "access baby" <nishkr...@gmail.com> wrote: > i would like to use combobox or list box in a form for data entry do i > have to have a table with value in it and the combobox or list box > should look in to that table or i type in the values. &...

Combo box LimitToList property setting of No
Combo box LimitToList property setting of No does not prevent the MS Access error "The text you enter must match an entry in the list" from popping up. What makes this bad is that the error is not a capturable error. My list has 2 fields: [Reason] and [ReasonCode]. The 2nd column is the bound column. Here's the RowSource property setting: Select [Reason],[ReasonCode] From [tblReasons]; I want the user to select a reason from the list, of course. But I DON'T want the user to see a MS Access error pop up in an app I rollout in a runtime environment built using Access 2.0 a...

Combo box fills text box
Hello again, I have a form that fills a text box with data according to the selection in the combo box. Two questions please: 1) The combo box does not have a control source so when opening the form, the combo box is empty but the text box already contains the first record. What do I need to do to either have both the combo box and text box empty on open or have both contain the first record on open. (If it takes VBA code, please point me in the right direction as I have not worked with it since '99). 2) I'm getting a runtime error 3077 on one of the records. I checked it to see i...

Text box linked to combo box
Good day, I am new to Access and need a question answered please. I have a form based on a table (tblQualityEmployees), for some of the fields it looks up a value in another table (tblGroups). The tblQualityEmployees consists of the following: EmployeeID FirstName LastName Group1 Group2 Group3 Group4 Group5 The tblGroups consists of the following: GroupID Groups Description What i want to do is, in the form have text box that displays the Group description next to each group. I tried making the "Control Source" field Group1 combo. This brings in the relevant ID number which is...

help: combo box vs. text box
Please help! I have a table "tblDept" with columns like DeptName, DeptChair, DeptPhone. In a form, I created a combo list that holds all the DeptName. By selecting one of the DeptName from the combo list, I want the DeptChair and DeptPhone to be shown automatically in two text boxes. The following code is trying to show the DeptChair in a text box. Private Sub cboDeptName_AfterUpdate() Dim MySQL MySQL = "SELECT DeptChair " MySQL = MySQL & "FROM tblDept " MySQL = MySQL & "WHERE AttorneyName = " MySQL = MySQL & "'" &...

Listbox based on text box and combo box.
On an unbound form, I have a combobox called 'cboproducttype' and a text box called 'txtamountappliedfor'. I have an Add button that I would like the user to be able to hit once a product and amount applied for has been entered. This should populate an unbound listbox to display their selections. A user can select one or more sets of product types and the amount applied for. They should also have the functionality to remove a 'set' if they made a mistake without the need to rebuild the whole listbox of selections. Then - I want to loop through the listbox of select...

How can I link the combo box to the edit box
Hi, I have a form that there is a combo box and an edit box. I have a table with Customer ID, Company Name and Country. I want to do that when my combo box chooses an item(eg McDonald in Company Name) in the form, the edit box can show another item (eg USA in Country) after the trigger. How can I do that? I've tried to do so, but the edit box still cannot show the related item, but only blank to let me enter info. Thx very much! Raymond Make sure you combo returns the Country in a column - it can be hidden by setting that column width to 0. In the Control Source for the text box put - ...

Populate text boxes with combo box selection
I need to populate text boxes for instance with employee information using their unique employee works number selected from a combo box. Can anyone help, I am told thru visual basic this can be achieved. godber wrote: > I need to populate text boxes for instance with employee information > using their unique employee works number selected from a combo box. > Can anyone help, I am told thru visual basic this can be achieved. You can do it without VBA. Add extra columns to the combo box Set the width of the columns to 0 if you want to hide them In the text bnoxes you want to show the...

combo box / text box php mysql
this is the the code, now here is the final result.... I get one combo box and one tex box come up, but they are empty... DAMN!!! Any ideas on what Im doing wrong please.. Thanks Again <?php require_once('..\library_database\Connections\onlinequote.php'); ?> <? function select_cases_price () { $qy = "SELECT SellingPrice, Description FROM cases"; $rs = mysql_query ($qy) or die (mysql_error ()); while (mysql_fetch_array ($rs)) { $select .= "<option value='{$r[0]}'>{$r[0]}</option>\n"; $prices[] = $r{1}; } return array ($select, $prices);...

Web resources about - Update combo box when another combo box onchange event - comp.databases.ms-access

JavaScript - Wikipedia, the free encyclopedia
programming styles. JavaScript was formalized in the ECMAScript language standard and is primarily used in the form of client-side JavaScript ...

OnFocus! OnBlur! OnChange! How I am going to learn how to code
I've been meaning to learn how to code beyond HTML for years now, but never have managed to do much more than borrow other people's cryptic code ...

CBC Television Series 1952 to 1982, A
A Is For Aardvark Wed 10:00-10:30 p.m., 7 Jul- 22 Sep 1954 Thu 10:30-11:00 p.m., 30Sep- 21 Oct 1954 A half- hour summer series, created, produced,and ...

DOTA2国际邀请赛全程比赛视频_新浪游戏看游戏_新浪游戏_新浪网
对抗游戏巨制Dota2于八月举行了国际邀请赛,邀请世界上各支著名Dota战队上演了精彩的Dota2大战,新浪看游戏特别推出Dota2邀请赛视频库,让你一次看个够。

閲嶈淇℃伅-閲嶅簡浜哄彛缃?/title>
鏈珯鎼滅储 浣滆€?/Option> 鏍囬 鍐呭 绠€浣?/A> 绻佷綋 璁句负棣栭〉 鍔犲叆鏀惰棌 鏀垮姟淇℃伅 鏈烘瀯鑱岃矗 淇℃伅鍏紑 閲嶈淇℃伅 宸ヤ綔淇℃伅 鍖哄幙淇℃伅 娉曞緥娉曡 閫氱煡鍏憡 澶т簨璁?/A> 鍔炰簨澶у巺 涓嬭浇涓績 璇佷欢鍔炵悊 琛屾斂瀹℃壒 ...

婀栧寳鐪佸叕瀹夊巺闂ㄦ埛缃戠珯骞冲畨鑽嗘缃?/title>
鐑偣鎺掕 鍏ㄧ渷487鍚嶆柊鐗硅缁撴潫鍩硅濂旇荡鍚勮嚜宀椾綅 鐪佸叕瀹夊巺鍓巺闀跨幇鍦烘寚鎸ラ珮绌烘晳浜?/a> 瀛熷缓鏌卞湪瑙傛懇鍏ㄥ浗鍏畨鐗硅澶х粌鍏垫垚鏋滄眹鎶ユ紨缁冨苟鍑哄腑鍏ㄥ浗鍏畨鐗硅闃熷缓璁惧骇璋堜細鏃跺己璋冩€荤粨缁忛獙鎶婃彙瑙勫緥 涓嶆柇鎻愬崌 ...

缃戜笂淇¤
... 蹇樿瀵嗙爜 鎮ㄥ綋鍓嶇殑浣嶇疆锛? 淇¤涓婚〉 淇¤鍏紑 鏍囬 鐣欒█鏃ユ湡 鎬绘暟 0 涓? - 棣?椤?涓婁竴椤? 涓嬩竴椤?鏈?椤点€€椤垫锛?font color=red> 0 /0椤点€€10鏉?椤点€€绗?select name='pagerNo' on ...

灞辫タ路楂樺钩-鍏紬鏈嶅姟
灞辫タ鏀垮簻缃?/a> 涓浗鏀垮簻缃?/a> 棣栥€€銆€椤?/a> 璧拌繘楂樺钩 璧勮涓績 缁勭粐鏈烘瀯 鍏氭斂棰嗗 鏀垮姟鍏紑 鎶曡祫鍒涗笟 楂樺钩鏃呮父 鍏紬鏈嶅姟 澶╂皵锛?/div> 11鏈?6鏃ュぉ姘斻€佺┖姘旀棩鎶?/a> 绔欏唴鎼滅储锛?/font> 棰嗗鑷磋緸 ...

2003 Acura CL Classifieds
To find a large selection of 2003 Acura CL used cars in the Automobile Magazine auto classifieds. Browse our vast inventory of used 2003 CL vehicles ...

Used Car Advanced Search - Automotive.com
Use our advanced search tool to view the used car classifieds at Automotive.com.

Resources last updated: 3/20/2016 3:27:47 PM