U3F1ZWV6ZTIyMDQ4MjY4MjEyMjA5X0ZyZWUxMzkwOTk1NDEyMDg5MQ==

006 MS Access VBA –Decision Making Select Case

الحجم




Sub TestButtons()
Dim question As String
Dim bts As Integer
Dim myTitle As String
Dim myButton As Integer
question = "Do you want to preview the report now?"
bts = vbYesNoCancel + vbQuestion + vbDefaultButton1
myTitle = "Report"
myButton = MsgBox(prompt:=question, buttons:=bts, Title:=myTitle)
Select Case myButton
        Case 6
              DoCmd.OpenReport"Sales by Year", acPreview
        Case 7
              MsgBox"You can review the report later."
       Case Else
                MsgBox"You pressed Cancel."
End Select
End Sub


\\\\\\\\\\\\\\\\\\\
Select Case myNumber
         Case Is <= 10
              MsgBox"The number is less than or equal to 10."
         Case 11
             MsgBox"You entered 11."
       Case Is >= 100
            MsgBox "The number is greater than or equal to   100."
       Case Else
            MsgBox "The number is between 12 and 99."
End Select

\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Sub DisplayDiscount()
   Dim unitsSold As Integer
  Dim myDiscount As Single
  unitsSold = InputBox("Enter the number of sold units:")
myDiscount= GetDiscount(unitsSold)
MsgBox myDiscount
End Sub

\\\\\\\\\\\\\\\\\
Select Case unitsSold
Case 1 To 200
GetDiscount = 0.05
Case 201 To 500
GetDiscount = 0.1
 Case 501 To 1000
GetDiscount = 0.15
Case Is > 1000
GetDiscount = 0.2
End Select


\\\\End Function

\\\\\\\\\\\\\\\


vba محتوى كورس الاكسيس
مسلسلاسم الملفالمدة ب الدقيقةلينك
1001 MS Access VBA Grouping Code , Variables And Data Types18https://youtu.be/iT1bFbliG5E
2002 MS Access VBA – Writing First Code 2 programs in one form16https://youtu.be/h-jXH_kcE4c
3003 MS Access VBA – Writing First 2 programs14https://youtu.be/Z36lpESNk8k
4004 MS Access VBA –Decision Making if then24https://youtu.be/phtKVh-QQ9w
5005 MS Access VBA –Decision Making if then elsif nested if16https://youtu.be/IRYnGtcoJKo
6006 MS Access VBA –Decision Making Select Case20https://youtu.be/32OckF0Zv6I
110 قائمة ملفات تعلم اكسيس المستوى الاول MS Access 380 min
https://www.youtube.com/playlist?list=PLMmy9Ec9B98wxI2RWVrjjtyV2knTFoR1t


الاسمبريد إلكترونيرسالة