M
MUHAMAMD SALIM SHAHZAD
dear sir can you help me that where i am wrong in this syntax
Private Sub btnTest_Click()
Dim sqlrenewal As String
sqlrenewal = "INSERT INTO tblCS (PolicyNo, Sistname, exp_SI, exp_Prem,
dt_Renewal )" & _
"SELECT DISTINCT" & _
"qryFireRenewal.POLICYNO, qryFireRenewal.SISTNAME,
qryFireRenewal.SI_TOTAL, qryFireRenewal.PREM_TOTAL,
qryFireRenewal.EXPIRYDATE" & _
"FROM qryFireRenewal" & _
" WHERE (((qryFireRenewal.EXPIRYDATE)>= " & _
Forms!reportFire!txtStartDate & _
" And (qryFireRenewal.EXPIRYDATE)<= " & _
Forms!reportFire!txtEndDate & _
" ));"""
DoCmd.SetWarnings False
DoCmd.RunSQL sqlrenewal
End Sub
Private Sub btnTest_Click()
Dim sqlrenewal As String
sqlrenewal = "INSERT INTO tblCS (PolicyNo, Sistname, exp_SI, exp_Prem,
dt_Renewal )" & _
"SELECT DISTINCT" & _
"qryFireRenewal.POLICYNO, qryFireRenewal.SISTNAME,
qryFireRenewal.SI_TOTAL, qryFireRenewal.PREM_TOTAL,
qryFireRenewal.EXPIRYDATE" & _
"FROM qryFireRenewal" & _
" WHERE (((qryFireRenewal.EXPIRYDATE)>= " & _
Forms!reportFire!txtStartDate & _
" And (qryFireRenewal.EXPIRYDATE)<= " & _
Forms!reportFire!txtEndDate & _
" ));"""
DoCmd.SetWarnings False
DoCmd.RunSQL sqlrenewal
End Sub