473,797 Members | 3,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I change values for a Combo Box based on specific condition

66 New Member
In my DB i need to change the value for a Combo Box based on some condition..
These values r retrieved from 1 of the tables(Glass)
My Query is in my form 1 of the Combo boxes display these values,but i need to change these values once the form is Loaded.

For Ex-If the Combo Box contains value as "Sliding door" it shud display the value in the Form as "SD".
Here for this if the table contains 10 such records as "Sliding Door",then for all the Records the new value displayed in the Formusing Combo Box shud be "SD".

Similarly if the table contains value as "Fixed",the actual value displayed in the Combo Box in the Form shud be "FP".

On which event do i need to write this code....
Expand|Select|Wrap|Line Numbers
  1. If Combo="Sliding Door" then
  2. Combo="SD"
  3. end if
In this code if i use for loop how do i refer to Total no of Records in the form.

Can anyone Plz help me on this...
Apr 15 '10 #1
1 2307
NeoPa
32,579 Recognized Expert Moderator MVP
If you set up the ComboBox in the first place to include columns for what you want to see and what value you want returned, then you simply display only the former, and set the Bound Column to the latter.

Access has been designed to make many of the more common requirements as easy as possible. The problem is that many people don't realise this and try to do it all the complicated way. I suggest you use the F1 key (Context-sensitive help) on the following attributes to get a better understanding of what can easily be done :
Row Source
Column Count
Column Widths
Bound Column
Apr 15 '10 #2

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

Similar topics

1
2923
by: Ryann | last post by:
Hello. I have a form with a series 5 combo-boxes. All 4 contain the same query which lists Parts based on a productID from a previous form. i.e. cboPart1 = Part ID, Part, ProductID Where ProductID = Form!frmName!cboProductID cboPart2 = Part ID, Part, ProductID Where ProductID = Form!frmName!cboProductID
4
2617
by: DebbieG | last post by:
I have a form based on this query: SELECT Students.LastSerDT, OtherInfo.Served, OtherInfo.HSGradYr, OtherInfo.ActivePart, OtherInfo.Served, Students.SSN, & ", " & & " " & AS Name, Students.LastNM, Students.FirstNM, Students.MI, Students.DOB, Students.GenderCD, Students.EthnicityCD, Students.EligibilityCD, Students.UBInitiative, Students.NCESSchID, Students.ProjEntryDT, Students.ProjReEntDT, Students.LastSerDT, Students.Reason,...
1
1953
by: Aravind | last post by:
Hi folks. My database project has the following: -------------------------------------------------------------------------------- tables: Member: MemName, MemNo , MemType, CourseFaculty History: contains all of the above queries:
2
1560
by: Dan Cook | last post by:
Ok... here's the scoop... I've got an unbound form with Serial Number, Building, and Room... all this is in tableA... Now I've got the form setup with building, room and serial number as combo fields... I've got it so that when you click the dropdown on Building it queries the table for all buildings, then the one for room queries for all the rooms in the picked building, and the serial number drop down queries on building or building...
3
3657
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by names under properties "row source" "Phase 1" through "Phase 10" (there are 10 Phases I want to sort from) Once the phase has been selected a second combo box would populate.
1
2502
by: Intrepid_Yellow | last post by:
Hi, I have the following code that runs my report generator. The user selects a table from a combo box, then whatever fields they want from a list box. (This part all works and the report runs fine). There is then a combo box they can select a field from (eg CompanyID etc) and then the list box below that contains the values (eg Microsoft, Novell etc). These are all multi-select list boxes. Now I can get the code to work if the user...
4
2905
by: virtualgreek | last post by:
Dear All, First of all I would like to take the time to thank you all for your efforts and time spent at this wonderful forum. I have found it very helpful with numerous examples available for every level of user. I am facing a rather weird behaviour with a combo box on a subform (Continuous form). I have two tables. Order and Order_Details. The master form is based on the Orders tables and the details form (subform) is based on the...
5
1445
by: gokula309 | last post by:
Hi , I've a doubt using 2 frames in same page . PAGE 1 has 2 frames called F1 and F2. F1 refers page P2 F2 refers page P3 In this P2 has a drop down list (bank ), when it's changed branch combo get loaded depend on bank code using BankCode_SelectedIndexChanged event.
4
15493
by: Michael | last post by:
I have a repeater web control. Currently I want to change some row's color based on defined condition. Is there any code sample demonstrating how to accomplish it? Thanks.
2
5074
by: mygirl22 | last post by:
Hi, I used this code to created 2 combo boxes General and Specific...and Only show Specific (Combo B) when Combo A is chosen..... What i need now is to know how to assign specific values to the items in combo b (Specific).??? If i chose a sode, Fanta, i want the total price to be $20.00 (this price will show up in the finial price box....Please Help!! drinkComboBox.Items.Clear() 'Clears the old items out of the drinkComboBox ...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10246
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7560
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3750
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2934
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.