Visual Basic 6 Code
Functions/Procedures
InQuotes Function
PauseTime Proc.
Remove Invld Chr Function
Database Insert Proc.
Database Select Function
Database Delete Proc.
Database Update Function
Make Enter key to act as TAB
Time calculation
Change 1st char to Ucase
Populate MSFlxGrid with db data
How to use CASE
Save file
Open file
Populate TreeView w/database
Catch RDO Error
Populate TreeView with data from the database
Public Sub cmdOK_Click() '************************************************************* 'Procedure: Public Method cmdOK_Click 'Author: Ahmad E. Ashparie 'Module: Form1 'Project: Project1 'Parameters: ' '************************************************************* Dim Resultset As rdoResultset Dim strSql As String Dim rdoqryCurr As RDO.rdoQuery Dim rdorstCurr As RDO.rdoResultset Cancel_Search_Flag = False Set ndesCurr = tvwCatalog.Nodes tvwCatalog.Nodes.Clear Screen.MousePointer = vbHourglass strSql = "select * from person where prsn_last_name=" _ & InQuotes(txtLastName.Text) & " and prsn_first_name=" _ & InQuotes(txtFirstName.Text) & "" StatusBar1.Panels(4).Text = "Searching ..." 'Anm_wait 'open resultset Set Resultset = DBPrePost.OpenResultset _ (strSql, rdOpenForwardOnly, rdConcurReadOnly) With Resultset If .EOF And .BOF Or Cancel_Search_Flag = True Then 'Unload frmWait 'Set frmWait = Nothing Form1.SetFocus Screen.MousePointer = vbDefault If Cancel_Search_Flag = False Then MsgBox "No Records Found!", vbExclamation, "MyApp - Info" End If Exit Sub Else 'Unload frmWait Form1.SetFocus cmdOK.Enabled = False End If tvwCatalog.Enabled = True ndesCurr.Clear Set ndeCurr = _ ndesCurr.Add(, , "Root", "Person Screen Info") ndeCurr.Expanded = True With Resultset Do Until .EOF Or Cancel_Search_Flag = True Set ndeCurr = _ ndesCurr.Add("Root", tvwChild, "c" & lngIdx, (!prsn_ssn_id), "folder_closed", "folder_open") .MoveNext lngIdx = lngIdx + 1 Loop End With tvwCatalog.SetFocus Set tvwCatalog.SelectedItem = tvwCatalog.Nodes(1) cmdOK.Enabled = False End With Close StatusBar1.Panels(4).Text = "" cmdOK.Enabled = False Screen.MousePointer = vbDefault End Sub
-
HOME
|
ABOUT
|
CONTACT US
Copyright © 2009 ASP-VBCode