السلام عليكم ورحمة الله وبركاته
الملف المرفق به برنامج تصدير التقرير على شكل صوره
المشكله في الملف عند تحديد التاريخ لاظهار تاريخ معين .... يظهر كل التواريخ في صورة التقرير
ياترى ما الحل
ارجووو المساعده ولكم جزيل الشكر
Dim DateFile As Date
DateFile = Date
Dim frm As Form
Dim ctl As Control
Set frm = Forms!FrmByDate
Dim mywhere As String
mywhere = "[Date]>0"
For Each ctl In frm
If ctl.Tag <> "" And InStr(ctl.Name, "dat") > 0 Then
If ctl.Value > 0 Then
Select Case ctl.Value
Case 1
mywhere = mywhere & " and " & ctl.Tag & " between cdate('" & Me(ctl.Name & "1") & "') and cdate('" & Me(ctl.Name & "2") & "')"
Case 2
mywhere = mywhere & " and " & ctl.Tag & " = cdate('" & Me(ctl.Name & "1") & "')"
Case 3
mywhere = mywhere & " and " & ctl.Tag & " > cdate('" & Me(ctl.Name & "1") & "')"
Case 4
mywhere = mywhere & " and " & ctl.Tag & " < cdate('" & Me(ctl.Name & "1") & "')"
End Select
End If
End If
Next
Dim n As String
NameFile = "DateReport" & Format(DateFile, "yyyy-mm-dd")
n = "C:" & "\" & NameFile & ".snp"
DoCmd.OutputTo acReport, "rptByDate", "Snapshot Format (*.snp)", n, True, "", 0
End Subكيف اضيف mywhere في كود تصدير التقرير على شكل صوره