By failing to prepare, you are preparing to fail.
- Benjamin Franklin
News
Site News
Latest Comments
Affiliates
Proxies
Contribute!
Chat
Tutorials
Newest Articles
Most Popular
Highest Rated
Latest Comments
Code Samples
Newest Code
Most Popular
Highest Rated
Latest Comments
Blogs
Admins Blog
Newest Blogs
Most Popular
Highest Rated
Latest Comments
Forums
Latest Posts
Latest Topics
Memberlist
[login]
|
[Register]
Lookup Form
by: bs0d
Description:
This example is of a veterinarian clinic to look up costs based on 2 letter code for procedure performed. Select case does all the work because the example codes are hard coded in the program, not retrieved from a database, ect. Click the picture to see what it should look like
See Full Size
Code:
Private Sub cmdClear_Click() 'Clears us with a clean slate txtCode.Text = "" lstProcedure.Clear txtCode.SetFocus End Sub Private Sub cmdExit_Click() 'Will terminate the program End End Sub Private Sub cmdLookup_Click() Dim intRes As Integer 'Will do all the work Select Case UCase(txtCode.Text) Case "TC" lstProcedure.AddItem ("Teeth Cleaning $50") Case "RV" lstProcedure.AddItem ("Rabies Vaccination $15") Case "OS" lstProcedure.AddItem ("Other Shots $5") Case "HW" lstProcedure.AddItem ("Heartworm Test $15") Case "FC" lstProcedure.AddItem ("Fecal Check $5") Case "OV" lstProcedure.AddItem ("Office Visit $15") Case Else intRes = MsgBox("The code entered was invalid.", vbCritical, "Invalid Entry") txtCode.SelStart = 0 txtCode.SelLength = 2 txtCode.SetFocus End Select lstProcedure.Visible = True End Sub Private Sub cmdPrint_Click() 'Will print the form on the screen cmdLookup.Visible = False cmdPrint.Visible = False cmdClear.Value = False cmdExit.Visible = False Print Form cmdLookup.Visible = True cmdPrint.Visible = True cmdClear.Visible = True cmdExit.Visible = True End Sub Private Sub Form_Load() 'Will center the form on the screen frmMain.Left = (Screen.Width - frmMain.Width) / 2 frmMain.Top = (Screen.Height - frmMain.Height) / 2 End Sub
No Comments for this page.
You Must be
signed in
or a
member
to comment.
Code Stats
332,278
Views
0
Total Comments
0
Rating of 5 (
Votes)
Code Options
·
Login to Rate This Code
·
Login to Post a Comment
·
Read more by this author
Related
·
RGB Color Fader
·
Adder
·
Math Problems
·
Cut and Paste
·
Combo Box Colors
·
Flag Viewer
"AllSyntax.com" Copyright © 2002-2021; All rights lefted, all lefts righted.
Privacy Policy