buddy
unread,Dec 29, 2009, 7:21:02 AM12/29/09You 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
can anyone help me with the code below, i cannot use the command to generate
reports twice, it only displays once. is anything wrong with the code?
Dim mygen As Recordset
Dim cab As ADODB.Connection
Set cab = New ADODB.Connection
Set mygen = New Recordset
cab.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=
C:\accesss\abtab.mdb;"
cab.Open
qry = "INSERT INTO tabrep ([ddate], ab_user, comp_name, ab_compl, ab_issue,
ab_sol, ab_status, branche)"
qry = qry & " SELECT helpd.ddate, helpd.ab_User, helpd.Comp_name,
helpd.ab_Compl, helpd.ab_Issue, helpd.ab_Sol, helpd.ab_Status, helpd.branche"
qry = qry & " From helpd"
If chkall.Value = 1 Then
qry = qry & " WHERE (((helpd.ddate) Between #" & dtdate1 & "# And #" &
dtdate2 & "#));"
Else
If chkname.Value = 1 Then
qry = qry & "where (((helpd.ab_user)= '" & cmbname & "') AND
((helpd.ddate) Between #" & dtdate1 & "# And #" & dtdate2 & "#));"
Else
If chksts.Value = 1 Then
qry = qry & "where (((helpd.ab_status)= '" & cmbsts & "') AND
((helpd.ddate) Between #" & dtdate1 & "# And #" & dtdate2 & "#));"
Else
If chkbr.Value = 1 Then
qry = qry & "where (((helpd.branche)= '" & cmbbr & "') AND
((helpd.ddate) Between #" & dtdate1 & "# And #" & dtdate2 & "#));"
End If
End If
End If
End If
ty = "Delete * from tabrep"
cab.Execute ty
cab.Execute qry
cr.Connect = cab.ConnectionString
cr.ReportFileName = "C:\accesss\abn1.RPT"
cr.Action = 1