473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Case Statement in Access - Don't know the synax for Access

46
I'm not very clear on the synax when creating a CASE statement in Access. Please take a look at this and guide me on the appropriate syntax please. Thanks

Private Sub txtCount_Exit(Cancel As Integer)
' Establishing perameters around counts for conferences
Select Case Me.cbxHosp

Case 1
Me.cbxHosp.Value = "Morning Reports" And Me.txtCount.Value > 20
MsgBox ("Morning Rounds <=20)

Case 2
Me.cbxHosp.Value = "Noon Conference" And Me.txtCount.Value > 20
MsgBox ("Noon Reports can be <=20")

Case 3
Me.cbxHosp.Value = "Grand Rounds" And Me.txtCount.Value > 5
MsgBox ("Grand rounds are <= 5")
End Select


End Sub
Apr 18 '07 #1
1 2194
MMcCarthy
14,534 Expert Mod 8TB
Try this ...
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtCount_Exit(Cancel As Integer)
  2. ' Establishing perameters around counts for conferences
  3.     Select Case Me.cbxHosp
  4.  
  5.       Case "Morning Reports"
  6.       If Me.txtCount.Value > 20 Then MsgBox "Morning Rounds <=20"
  7.  
  8.       Case "Noon Conference"
  9.       If Me.txtCount.Value > 20 Then MsgBox "Noon Reports can be <=20"
  10.  
  11.       Case "Grand Rounds"
  12.       If Me.txtCount.Value > 5 Then MsgBox "Grand rounds are <= 5"
  13.    End Select
  14.  
  15. End Sub
  16.  
Mary
Apr 18 '07 #2

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

Similar topics

26
by: Joe Stevenson | last post by:
Hi all, I skimmed through the docs for Python, and I did not find anything like a case or switch statement. I assume there is one and that I just missed it. Can someone please point me to the...
9
by: cousaert | last post by:
Newsgroups: alt.comp.lang.learn.c-c++ Date: Fri, 27 Aug 2004 12:36:11 +0200 Lines: 36 User-Agent: KNode/0.7.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii...
5
by: DaaaDaaa | last post by:
Hi, Here's what I'd like to do: table (Orders) has fields of Processed, Paid (both of boolean yes|no) etc, I want to return a count of of Total number of Orders, Number of Processed vs. Number...
15
by: Benny Raymond | last post by:
I'm confused as to how fallthrough is limited in switch. For example the following works: string switch_test = "a"; switch (switch_test) { case "a": case "b": case "c": doSomething(a);
110
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
9
by: yndygo | last post by:
Alright then - I know it's got to be out there somewhere, but I can't find it... I'm looking at a piece of code and there's some debate as to what the behavior will be. Given a switch/case...
2
by: cbs81 | last post by:
hi all, problem: transferring data from workbooks that are stored in a particular directory from excel to a table in access. when done, the workbooks that have been processed are automatically...
2
by: fperri | last post by:
Hi, I have a table with over 20 columns. Seven of these of these columns correspond to a filter on a search form. Based on what is selected on the search form, and what is in these seven fields in...
21
beacon
by: beacon | last post by:
Hello to everybody, I have a section on a form that has 10 questions, numbered 1-10, with 3 option buttons per question. Each of the option buttons have the same response (Yes, No, Don't know),...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...

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.