A level computing project - FINISHED

Page 167

167

‘If no service ID has been selected a message appears informing the user of that and the cursor is set to the aforementioned field ’ If cmbServices = Empty Then MsgBox ("Fill in aforementioned details first") txtBillNo.SetFocus Exit Sub End If End Sub Private Sub txtAdvance_KeyPress(KeyAscii As Integer) ‘Here the command ensures that only numbers are entered into the field if anything besides numbers or the selected symbols is entered the field is erased and the cursor is set to that field' If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) Then MsgBox ("Only numbers are allowed in this field") txtAdvance.Text = Empty KeyAscii = 0 txtAdvance.SetFocus End If End Sub Private Sub txtBillNo_Change() ‘If the number of characters in this field exceeds 3 a message shows informing the user of the error and the field is made blank.’ If (Len(txtBillNo.Text) > 3) Then MsgBox ("Bill number can't exceed 3 integers!") txtBillNo.Text = "" End If End Sub Private Sub txtBillNo_KeyPress(KeyAscii As Integer) ‘Here the command ensures that only numbers are entered into the field if anything besides numbers or the selected symbols is entered the field is erased and the cursor is set to that field' If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) Then MsgBox ("Only numbers are allowed in this field") txtBillNo.Text = Empty KeyAscii = 0 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.