Kamis, 17 Januari 2019

Re: [MS_AccessPros] Re: Problem with Select Case Statement

 

Giorgio, please remember to keep previous messages when you reply so we don't have to dig through posts to see how to help. You wrote:

-------------------------------------------------------
Access 2010, Windows 7
I am adding case statements to after update of Unbound Combo Box. After first few VBA automatically keeps adding "Is" after the Case and it does not let me to delete them. See below, please help. Ken
Private Sub Combo46_AfterUpdate()
Select Case Me.Combo46
Case "American Eagle"
Me.Stock = "AEO"
Case "Broadcom Inc"
Me.Stock = "AVGO"
Case "XPERI CORPORATION"
Me.Stock = "XPER"
Case "Bank of America"
Me.Stock = "BAC"
Case Is = "Nextra Energy"
Me.Stock = "NE"
Case Is = "Ocean PWR"
Me.Stock = "OPTT"
Case Is = "Rigel Pharmaceuticals"
Me.Stock = "RIGL"

-------------------------------------------------------

As Duane suggested, a table is the way to go. I see 2 columns -- stock abbreviation, and stock name. It appears you want to pick by the name and store the abbreviation. You can create a combo box with 2 columns. Maybe you want to make 2 combo boxes, since you show the stock abreviation -- one that has the stock abbreviation, and the other that is sorted by stock name -- both bound to the stock abbreviation. Here is a video about combo boxes:

What is a Combo Box?
https://www.youtube.com/watch?v=2y85oDWaSh0

have an awesome day,
crystal


On 1/17/2019 3:32 AM, giorgio_rovelli wrote:
Hi Duane
If you used a table rather than hard-coding the values, how would Private Sub Combo46_AfterUpdate() turn out?
Giorgio

__._,_.___

Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Tidak ada komentar:

Posting Komentar