ZmrAbdulla
Technical User
Hi All,
The following code works fine if the user omit the date and try to save the record
'====================code============'
Private Sub Command50_Click()
On Error GoTo Err_Command50_Click
If IsNull(Date) Then
MsgBox "Please enter the date !!!", _
vbCritical + vbOKOnly, _
"Cartridge & Toner Inventory"
Cancel = True
Exit_Command50_Click:
Exit Sub
Err_Command50_Click:
Resume Exit_Command50_Click
End If
End Sub
'====================code============'
My question is What will be the code if the field (here it is Date) is on a subform? And the command button on the Main form.
Second question
One of my main forms have 3 fields
Name
TelNumber
FaxNumber
I need to use a MsgBox to tell the user If he omits any of the field and try to save.
If it is Name then tell "Plase enter the name"
Or If it is TelNumber then "Please enter the TelNumber"
Etc...etc..
But if the user omit two of them then the MsgBox should tell him the "Plase enter the Name and the TelNumber"
Is this possible?
Regards
Zameer Abdulla
The following code works fine if the user omit the date and try to save the record
'====================code============'
Private Sub Command50_Click()
On Error GoTo Err_Command50_Click
If IsNull(Date) Then
MsgBox "Please enter the date !!!", _
vbCritical + vbOKOnly, _
"Cartridge & Toner Inventory"
Cancel = True
Exit_Command50_Click:
Exit Sub
Err_Command50_Click:
Resume Exit_Command50_Click
End If
End Sub
'====================code============'
My question is What will be the code if the field (here it is Date) is on a subform? And the command button on the Main form.
Second question
One of my main forms have 3 fields
Name
TelNumber
FaxNumber
I need to use a MsgBox to tell the user If he omits any of the field and try to save.
If it is Name then tell "Plase enter the name"
Or If it is TelNumber then "Please enter the TelNumber"
Etc...etc..
But if the user omit two of them then the MsgBox should tell him the "Plase enter the Name and the TelNumber"
Is this possible?
Regards
Zameer Abdulla