|
|
|
|
| Data
Access Pages with VBScript |
|
| This example was taken from a Data
Access Page that my team and I created so that the eCarConnexions staff
could access the company database online. As you can see in the
accompanying code, validation was performed on each text/combo box to
ensure, first of all, that data was entered and second, that it was valid data. |
| |
|
 |
<SCRIPT language=VBScript>
sub cmdSave_OnClick()
'check for data in the Dealer Name field:
If frmDealers.txtDealer_Name.value = "" then
msgbox "Dealer Name must be completed.", 0 + 64, "eCarConnexions"
frmDealers.txtDealer_Name.focus
exit sub
'check that the data is valid:
elseif IsNumeric(frmDealers.txtDealer_Name.value) = True then
msgbox "Dealer Name must be text.",0 + 64,"eCarConnexions"
frmDealers.txtDealer_Name.focus
frmDealers.txtDealer_Name.value = ""
exit sub
else
end if
'check for data in the Dealer address field:
If frmDealers.txtStreet_Address.value = "" then
msgbox "Street Address must be completed.", 0 + 64, "eCarConnexions"
frmDealers.txtStreet_Address.focus
exit sub
else
end if
... |
|
| |
|
|
|
|
|