R
richard harris
Hi,
i have found via this forum how to validate data on save using this line of
code
If IsNull([Forms]![frmIDD]![IDDFeeRefund]) Then
MsgBox "Fee Refund field not completed", vbInformation, "Need
information "
End If
what i cant seem to do is the following.
if all fields ahve been validated i need to 'task A' if not i need to exit
the sub until the fields have been validated then move on to 'Task A' by
clicking the proceed button again.
currently the programme is giving the correct propts for the missing data,
but then proceeds to Task A without allowing the user to enter the data.
i tried this code after the intitial checking of the data. can anyone help
If IsNull(([Forms]![frmIDD]![IDDMORT]) Or ([Forms]![frmIDD]![IDDLIFETIME])
Or ([Forms]![frmIDD]![IDDBTL]) Or ([Forms]![frmIDD]![IDDPureProtection]) _
Or ([Forms]![frmIDD]![IDDHomeIns]) Or ([Forms]![frmIDD]![IDDASU]) Or
([Forms]![frmIDD]![IDDMortBasis]) Or ([Forms]![frmIDD]![IDDLifeTimeBasis]) _
Or ([Forms]![frmIDD]![IDDPureProtectionBasis]) Or
([Forms]![frmIDD]![IDDHomeInsBasis]) Or ([Forms]![frmIDD]![IDDASUBasis]) _
Or ([Forms]![frmIDD]![IDDMortAdv]) Or ([Forms]![frmIDD]![IDDInsAdv]) Or
([Forms]![frmIDD]![IDDFeeBasis]) Or ([Forms]![frmIDD]![IDDFeeRefund])) Then
If vbYes = MsgBox("Have you issued the IDD to your client. ", vbYesNo +
vbInformation, _
"IDD Issued") Then
Me.IDDConfirmIssued = True
Me.IDDIssued = "Yes"
Me.IDDIssueDate.Visible = True
Me.IDDIssueDate = Date
DoCmd.Close acForm, "frmIDD", acSaveYes
Else
MsgBox "You can not proceed unless you issue the IDD. ", vbOKOnly +
vbwarning, _
"IDD not Issued"
Me.IDDConfirmIssued = False
Cancel = True
End If
greatly appreciated. richard
i have found via this forum how to validate data on save using this line of
code
If IsNull([Forms]![frmIDD]![IDDFeeRefund]) Then
MsgBox "Fee Refund field not completed", vbInformation, "Need
information "
End If
what i cant seem to do is the following.
if all fields ahve been validated i need to 'task A' if not i need to exit
the sub until the fields have been validated then move on to 'Task A' by
clicking the proceed button again.
currently the programme is giving the correct propts for the missing data,
but then proceeds to Task A without allowing the user to enter the data.
i tried this code after the intitial checking of the data. can anyone help
If IsNull(([Forms]![frmIDD]![IDDMORT]) Or ([Forms]![frmIDD]![IDDLIFETIME])
Or ([Forms]![frmIDD]![IDDBTL]) Or ([Forms]![frmIDD]![IDDPureProtection]) _
Or ([Forms]![frmIDD]![IDDHomeIns]) Or ([Forms]![frmIDD]![IDDASU]) Or
([Forms]![frmIDD]![IDDMortBasis]) Or ([Forms]![frmIDD]![IDDLifeTimeBasis]) _
Or ([Forms]![frmIDD]![IDDPureProtectionBasis]) Or
([Forms]![frmIDD]![IDDHomeInsBasis]) Or ([Forms]![frmIDD]![IDDASUBasis]) _
Or ([Forms]![frmIDD]![IDDMortAdv]) Or ([Forms]![frmIDD]![IDDInsAdv]) Or
([Forms]![frmIDD]![IDDFeeBasis]) Or ([Forms]![frmIDD]![IDDFeeRefund])) Then
If vbYes = MsgBox("Have you issued the IDD to your client. ", vbYesNo +
vbInformation, _
"IDD Issued") Then
Me.IDDConfirmIssued = True
Me.IDDIssued = "Yes"
Me.IDDIssueDate.Visible = True
Me.IDDIssueDate = Date
DoCmd.Close acForm, "frmIDD", acSaveYes
Else
MsgBox "You can not proceed unless you issue the IDD. ", vbOKOnly +
vbwarning, _
"IDD not Issued"
Me.IDDConfirmIssued = False
Cancel = True
End If
greatly appreciated. richard