R
Rosebud
I converted an Access data entry form to a DAP. The user adds a new record
by completing the form and pressing the Submit button. The onclick event of
the button should verify certain fields and then add the record to the
database. The verification is working fine but I can't get the record added
to the database. I'm a rookie at this with no VBScript experience so I'm
sure I'm just coding it wrong. Here's a sample of the code that includes the
section I'm having problems with:
<BUTTON id=SubmitMe
style="Z-INDEX: 33; LEFT: 5.791in; WIDTH: 0.5in; POSITION: absolute; TOP:
2.164in; HEIGHT: 0.28in"
tabIndex=12 MsoTextAlign="General">Submit</BUTTON>
<SCRIPT language=vbscript event=onclick for=SubmitMe>
intErrorCount=0
If DropDownList0.value="" then
MsgBox "Please enter a name in the YOUR NAME field.",0,"Validation Error"
intErrorCount=1
End If
If ClientSelect.value="" then
MsgBox "Please select a client.",0,"Validation Error"
intErrorCount=1
End If
If RequestDescription.value="" then
MsgBox "Please enter a description for your request.",0,"Validation Error"
intErrorCount=1
End If
If DropDownList2.value="" then
MsgBox "Please select who we should contact - You or The
Client.",0,"Validation Error"
intErrorCount=1
End If
If DropDownList2.value="The Client" and ContactName.value="" then
MsgBox "You must provide a Contact Name if you want us to contact the
client.",0,"Validation Error"
intErrorCount=1
End If
If DropDownList2.value="The Client" and (Telephone.value="" and
Text1.value="")then
MsgBox "You must provide either a Telephone number or email address if
you want us to contact the client.",0,"Validation Error"
intErrorCount=1
End If
If intErrorCount=0 then
ADODB.Recordset.Update
MsgBox "Request Submitted to Standards and Practices.",0,"Confirmation
Message"
End If
</SCRIPT>
by completing the form and pressing the Submit button. The onclick event of
the button should verify certain fields and then add the record to the
database. The verification is working fine but I can't get the record added
to the database. I'm a rookie at this with no VBScript experience so I'm
sure I'm just coding it wrong. Here's a sample of the code that includes the
section I'm having problems with:
<BUTTON id=SubmitMe
style="Z-INDEX: 33; LEFT: 5.791in; WIDTH: 0.5in; POSITION: absolute; TOP:
2.164in; HEIGHT: 0.28in"
tabIndex=12 MsoTextAlign="General">Submit</BUTTON>
<SCRIPT language=vbscript event=onclick for=SubmitMe>
intErrorCount=0
If DropDownList0.value="" then
MsgBox "Please enter a name in the YOUR NAME field.",0,"Validation Error"
intErrorCount=1
End If
If ClientSelect.value="" then
MsgBox "Please select a client.",0,"Validation Error"
intErrorCount=1
End If
If RequestDescription.value="" then
MsgBox "Please enter a description for your request.",0,"Validation Error"
intErrorCount=1
End If
If DropDownList2.value="" then
MsgBox "Please select who we should contact - You or The
Client.",0,"Validation Error"
intErrorCount=1
End If
If DropDownList2.value="The Client" and ContactName.value="" then
MsgBox "You must provide a Contact Name if you want us to contact the
client.",0,"Validation Error"
intErrorCount=1
End If
If DropDownList2.value="The Client" and (Telephone.value="" and
Text1.value="")then
MsgBox "You must provide either a Telephone number or email address if
you want us to contact the client.",0,"Validation Error"
intErrorCount=1
End If
If intErrorCount=0 then
ADODB.Recordset.Update
MsgBox "Request Submitted to Standards and Practices.",0,"Confirmation
Message"
End If
</SCRIPT>