473,806 Members | 2,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Populating an option group by recognising 3 digits

Hello this is my first post to this group. I have a form on which the
user enters an eleven digit number the first three of which are a
special prefix. This prefix uniquely identifies an airline. Also on the
form is an option group of handling agents who process freight for
these airlines. Currently the user manually clicks one of the option
group boxes depending on the prefix entered. What I would like to do is
add an event procedure to the After update event which would recognise
the first three digits and populate the option group accordingly. Any
suggestions gratefully received

Jul 21 '06 #1
2 1684
On 21 Jul 2006 15:14:43 -0700, fishhead wrote:
Hello this is my first post to this group. I have a form on which the
user enters an eleven digit number the first three of which are a
special prefix. This prefix uniquely identifies an airline. Also on the
form is an option group of handling agents who process freight for
these airlines. Currently the user manually clicks one of the option
group boxes depending on the prefix entered. What I would like to do is
add an event procedure to the After update event which would recognise
the first three digits and populate the option group accordingly. Any
suggestions gratefully received
Code the AfterUpdate event of the text control:
If Left(Me![ControlName],3) = 123 Then
Me![OptionGroupName] = 1
ElseIf Left(Me![ControlName],3) = 456 Then
Me![OptionGroupName] = 2
Else
Me![OptionGroupName] = 3
End If

If you had lot's more choices Select Case might be easier to use then
If .. Then .. Else
Look it up in VBA help.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jul 21 '06 #2

fredg wrote:
On 21 Jul 2006 15:14:43 -0700, fishhead wrote:
Hello this is my first post to this group. I have a form on which the
user enters an eleven digit number the first three of which are a
special prefix. This prefix uniquely identifies an airline. Also on the
form is an option group of handling agents who process freight for
these airlines. Currently the user manually clicks one of the option
group boxes depending on the prefix entered. What I would like to do is
add an event procedure to the After update event which would recognise
the first three digits and populate the option group accordingly. Any
suggestions gratefully received

Code the AfterUpdate event of the text control:
If Left(Me![ControlName],3) = 123 Then
Me![OptionGroupName] = 1
ElseIf Left(Me![ControlName],3) = 456 Then
Me![OptionGroupName] = 2
Else
Me![OptionGroupName] = 3
End If

If you had lot's more choices Select Case might be easier to use then
If .. Then .. Else
Look it up in VBA help.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Thanks very much Fred for your suggestion

Jul 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1275
by: bigbuddha | last post by:
Hello, I have a form two multiple selectboxes. Firs one with options, second one empty I need to select a few items and hit an "add" button to get them in the second one. Preferably a "remove" button to. the second selectbox's name is "gen_list' cause i need it in for db handling. This might be something to keep in mind. If it's possible a re-useable funtion so i can use it for different
2
3867
by: Billy Smith | last post by:
How do you go about populating a select list from an XML file? I can open the XML file fine and get at all of the data, but I'm stuck on how to use that data in my <option> tags. Is it even possible? Thanks.
1
1401
by: Smriti Dev | last post by:
Hi There, Hope you can help!! I have a table which has records (0,1, 2, 3) and these records (takes in values from another table - for example - Yes, NO, Maybe, don't know) How can I get these values to come up in a form but the table to actually populate with the number 0,1, 2, 3 - ie. when yes is picked - O is filled. Thanks in advance! smriti
8
2552
by: jack-b | last post by:
Hi, I have a list box which displays countries names and a second listbox which displays their cites (based on the selection made in ListBox 1) If the user selects USA i want to display cities in the States - if the user selects multiple countries I want to display the cities in ALL the selected counties e.g. a user select US and England, the second list would display ally cities in England and all the cities in the US.
1
2246
by: Stephene | last post by:
New to the world of web design/php/mysql and need help please. What I'm trying to do: I would like a web page with three drop down menus each populated by a query The first represents locations ie Room1, Room2 etc The second represents locations within the rooms i.e Rack1, Rack2 etc
1
1538
by: evanburen | last post by:
I have 2 selectboxes and I want to change the values in the second based on the first one. I found a few examples of this but none of them quite do what I want. Could someone get me started on this or point me to an example? Thanks Box 1: <SELECT name="ddlAvailable"> <option value="A,B,C,D,E">All Sections</option> <OPTION VALUE = "A,B,C">A,B,C</Option>
11
4648
by: tokcy | last post by:
Hi everyone, I am new in php and ajax, i am facing the prob while i click on element of first drop down then in second dropdown all element showl come from database. I mean i have three dropdown 1. category which comes from database 2. brand which comes from databse according to content of first dropdown . and 3. price which is static. when i am doing these things without ajax on every onChange() thw whole page is refreshing that i do not...
14
4344
by: Philth | last post by:
Hi there, I've essentially got a form with several drop down, each populated by columns in various tables. The populating bit works fine - the column rows appear as they should in the menu. Ideally the user needs to make their selections, and enter the form into a new database table. The problem is, when the selection is entered into the new table, only the first word of the string is entered. For example, the drop down may have...
0
10371
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
10373
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7650
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
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5683
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
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
3852
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
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.