codetoad.com
  ASP Shopping Cart, Forum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Select Case for VBA in Excel  smith33 at 04:51 on Thursday, May 19, 2005
 

Hi was wondering if anyone could tell me why my code doesn't work right. It goes straight to the Invalid Store Entry box.
Thanks for the help

Select Case UCase(strStore)
Case "All"
qtbSales.CommandText = "SELECT * FROM 2002sales ORDER BY store, month"

Case "Glen Park", "Jackson", "Warren"
qtbSales.CommandText = "SELECT * FROM 2002sales WHERE store = '" _
& strStore & "' ORDER BY month"

Case Else
MsgBox prompt:="Invalid store entry", Buttons:=vbOKOnly + vbInformation

Exit Sub
End Select



<Added>

Hi I was wondering if anyone could tell me why my code doesn't work right. It goes straight to the Invalid Store Entry box.
Thanks for the help

Select Case UCase(strStore)
Case "All"
qtbSales.CommandText = "SELECT * FROM 2002sales ORDER BY store, month"

Case "Glen Park", "Jackson", "Warren"
qtbSales.CommandText = "SELECT * FROM 2002sales WHERE store = '" _
& strStore & "' ORDER BY month"

Case Else
MsgBox prompt:="Invalid store entry", Buttons:=vbOKOnly + vbInformation

Exit Sub
End Select









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  matrix addition
•  Re: Storing data from HTML to Excel or TXT
•  Re: function within loop problem
•  Re: Ô‡´ò¥¯¥é¥Ö¤Ã� ¥Æ©`¥é©`¥á¥¤¥É£ò£±£±¥¢¥¤¥¢¥ó ¤Î£··¬ ¤Ç¤¹
•  Re: Replace
•  Re: タイトリスト AP2アイアン 712ã�®æƒ…å �
•  Re: SMS from Perl using HTTP request
•  Re: Charl Schwartzel
•  Re: Adhyayan - Annual Student Conference and Online Coding Festival


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2013