A level computing project - FINISHED

Page 123

123

MsgBox ("The remarks have been left blank.") txtremarks.SetFocus Exit Sub End If 'Record will be saved in the doctor's table' Adodc1.Recordset.Update 'Command button NEW is enabled' cmdNew.Enabled = True 'Command button SAVE is disabled' cmdSave.Enabled = False ‘A message box appears informing the user’ MsgBox "Changes Saved" End Sub Private Sub cmdSearch_Click() ‘Sets the data type of s to String’ Dim s As String ‘An input box appears asking the input the ID of the employee whom you are running a search for.’ s = InputBox("Enter Employee ID", "INPUT") ‘The program runs through the file searching for a matching record.’ Adodc1.Recordset.Find ("EmployeeID= '" & (s) & "'") ‘If the cursor is it at the end of the file and yet no match has been found a message appears informing the user that no match was found.’ If Adodc1.Recordset.EOF Then MsgBox "No Match Found", vbExclamation, "Please enter a registered employee id" Adodc1.Refresh End If End Sub

Private Sub txtaddress_Change() ‘If the user attempts to enter an address exceeding 250 characters an error appears informing a user that he/she cannot do that and the cursor is set to the address field.’ If (Len(txtaddress.Text) > 250) Then MsgBox ("Address can't exceed 250 characters!") txtaddress.Text = "" End If NAINA RAISINGHANI PK 500


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.