asbo...@gmail.com
unread,Apr 24, 2014, 12:03:34 AM4/24/14You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
On Error Resume Next
Dim ipost
Dim iprint
cn.BeginTrans
If cmdNew.Caption = "&Save" Then
cn.Execute "INSERT INTO tblCashMemo(SerialNo,EDate,PaperNo,DonorName,DonorAdress,DonorPNo,RecipientName,RecipientAdress, " & _
" RecipientPNo,PaperType,PRate,Paid,PMNo,VolumeNo,PageNo,Remarks,strTime,Posted,UName) " & _
" VALUES ('" & txtSerialNo & "','" & Format(EDate, "dd-mm-yyyy") & "','" & parseQuotes(txtPaperNo) & "','" & parseQuotes(txtDName) & "','" & parseQuotes(txtDAdress) & "','" & parseQuotes(txtDPNo) & "'," & _
" '" & parseQuotes(txtRName) & "','" & parseQuotes(txtRAdress) & "','" & parseQuotes(txtRPNo) & "','" & parseQuotes(cmbPType) & "'," & _
" " & Val(txtPRate.text) & "," & Val(txtPaid.text) & "','" & parseQuotes(txtPMNo) & "','" & parseQuotes(txtVNo) & "','" & parseQuotes(txtPageNo) & "','" & parseQuotes(txtRemarks) & "','" & txtTime.text & "','" & txtCPost.text & "','" & txtUID.text & "') "
rcupdate = True
cn.CommitTrans
MsgBox "Record Added", vbInformation, "Confirmation"
ElseIf (cmdEdit.Caption = "&Update") Then
cn.Execute "Update tblCashMemo SET EDate='" & Format(EDate, "dd-mm-yyyy") & "',PaperNo='" & parseQuotes(txtPaperNo) & "',DonorName='" & parseQuotes(txtDName) & "',DonorAdress='" & parseQuotes(txtDAdress) & "', " & _
"DonorPNo='" & parseQuotes(txtDPNo) & "',RecipientName='" & parseQuotes(txtRName.text) & ",RecipientAdress='" & parseQuotes(txtRAdress.text) & ",RecipientPNo='" & parseQuotes(txtRPNo.text) & "', " & _
"PaperType='" & parseQuotes(cmbPType) & "',PRate=" & Val(txtPRate.text) & ",Paid=" & Val(txtPaid.text) & ", " & _
"PMNo='" & parseQuotes(txtPMNo) & "',VolumeNo='" & parseQuotes(txtVNo.text) & "',PageNo='" & parseQuotes(txtPageNo) & "', " & _
"Remarks='" & parseQuotes(txtRemarks) & "',strTime='" & (txtTime.text) & "',Posted='" & parseQuotes(txtCPost.text) & "',UName='" & txtUID.text & "' WHERE SerialNo = '" & txtSerialNo & "'"
rcupdate = True
cn.CommitTrans
MsgBox "Record Updated", vbInformation, "Confirmation"
'----------------------------------------------Printing Start--------------------------
ElseIf cmdPrint.Caption = "&Print" Then
txtCPost.text = "Posted"
iprint = MsgBox("Do you want to Print this Reservation?", vbYesNo)
If iprint = vbYes Then
cn.Execute "Update tblCashMemo SET EDate='" & Format(EDate, "dd-mmm-yyyy") & "',PaperNo='" & parseQuotes(txtPaperNo) & "',DonorName='" & parseQuotes(txtDName) & "',DonorAdress='" & parseQuotes(txtDAdress) & "', " & _
"DonorPNo='" & parseQuotes(txtDPNo) & "',RecipientName='" & parseQuotes(txtRName.text) & ",RecipientAdress='" & parseQuotes(txtRAdress.text) & ",RecipientPNo='" & parseQuotes(txtRPNo.text) & "', " & _
"PaperType='" & parseQuotes(cmbPType) & "',PRate=" & Val(txtPRate.text) & ",Paid=" & Val(txtPaid.text) & ", " & _
"PMNo='" & parseQuotes(txtPMNo) & "',VolumeNo='" & parseQuotes(txtVNo.text) & "',PageNo='" & parseQuotes(txtPageNo) & "', " & _
" Remarks='" & parseQuotes(txtRemarks) & "',strTime='" & (txtTime.text) & "',Posted='" & parseQuotes(txtCPost.text) & "',UName='" & txtUID.text & "' WHERE SerialNo = '" & txtSerialNo & "'"
rcupdate = True
cn.CommitTrans
End If
'----------------------------------Printing End---------------------------
'----------------------------------Posted Start--------------------------
ElseIf cmdPost.Caption = "&Posted" Then
txtCPost.text = "Posted"
ipost = MsgBox("Do you want to Post this bill?", vbYesNo)
If ipost = vbYes Then
cn.Execute "Update tblCashMemo SET EDate='" & Format(EDate, "dd-mmm-yyyy") & "',PaperNo='" & parseQuotes(txtPaperNo) & "',DonorName='" & parseQuotes(txtDName) & "',DonorAdress='" & parseQuotes(txtDAdress) & "', " & _
"DonorPNo='" & parseQuotes(txtDPNo) & "',RecipientName='" & parseQuotes(txtRName.text) & ",RecipientAdress='" & parseQuotes(txtRAdress.text) & ",RecipientPNo='" & parseQuotes(txtRPNo.text) & "', " & _
"PaperType='" & parseQuotes(cmbPType) & "',PRate=" & Val(txtPRate.text) & ",Paid=" & Val(txtPaid.text) & ", " & _
"PMNo='" & parseQuotes(txtPMNo) & "',VolumeNo='" & parseQuotes(txtVNo.text) & "',PageNo='" & parseQuotes(txtPageNo) & "', " & _
" Remarks='" & parseQuotes(txtRemarks) & "',strTime='" & (txtTime.text) & "',Posted='" & parseQuotes(txtCPost.text) & "',UName='" & txtUID.text & "' WHERE SerialNo = '" & txtSerialNo & "'"
rcupdate = True
cn.CommitTrans
MsgBox "Record Posted Successfully", vbInformation, "Confirmation"
End If
End If
' cn.CommitTrans
' Exit Sub
Exit Function