If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Prompt to enter date again

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-10-06, 13:57
mustish1 mustish1 is offline
Registered User
 
Join Date: Jul 2006
Posts: 149
Prompt to enter date again

Hi:
When i run my report it ask me a prompt to Enter Date, I already enter date from the parameter form, I dont know why it ask me to enter date. The date variable is in the query but i didnt define into the report

Private Sub cmd_prntrpt_Click()
On Error GoTo Err_cmd_prntrpt_Click
If IsNull(Me.ddlcrc) = False Then
WCriteria = "[crc] = '" & Me.ddlcrc & "'"
End If

If IsNull(Me.ddlwm_desc) = False Then
If Len(WCriteria) > 0 Then
WCriteria = WCriteria & " AND [wm_desc] = '" & Me.ddlwm_desc & "'"
Else
WCriteria = "[wm_desc] = '" & Me.ddlwm_desc & "'"
End If
End If

If IsNull(Me.txtDate1) = False And IsNull(Me.txtDate2) = False Then
If Len(WCriteria) > 0 Then
WCriteria = WCriteria & " AND ([WM_Date] BETWEEN #" & _
Me.txtDate1 & "# AND #" & Me.txtDate2 & "#)"
Else
WCriteria = "[WM_Date] BETWEEN #" & _
Me.txtDate1 & "# AND #" & Me.txtDate2 & "#"
End If
Else
If IsNull(Me.txtDate1) = False Then
If Len(WCriteria > 0) Then
WCriteria = WCriteria & " AND [WM_Date] = #" & Me.txtDate1 & "#"
Else
WCriteria = "[WM_Date] = #" & Me.txtDate1 & "#"
End If
ElseIf IsNull(Me.txtDate2) = False Then
If Len(WCriteria > 0) Then
WCriteria = WCriteria & " AND [WM_Date] = #" & Me.txtDate2 & "#"
Else
WCriteria = "[WM_Date] = #" & Me.txtDate2 & "#"
End If
End If
End If

Dim stDocName As String
DoCmd.OpenReport "rpt_qrywebmail2", acPreview, , WCriteria
Forms!frmWeb_Mailfilter.Visible = False
Exit_cmd_prntrpt_Click:
Exit Sub

Err_cmd_prntrpt_Click:
MsgBox Err.Description
Resume Exit_cmd_prntrpt_Click

End Sub


QUERY
-----
SELECT tbl_WebMail.CRC, Sum(tbl_WebMail.WM_Amt) AS Totamnt
FROM tbl_WebMail
WHERE (((tbl_WebMail.WM_Date) Between [Forms]![frmWeb_Mailfilter]![txtdate1] And [Forms]![frmWeb_Mailfilter]![txtdate2]))
GROUP BY tbl_WebMail.CRC;
Reply With Quote
  #2 (permalink)  
Old 09-11-06, 08:17
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
What is the exact message?
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #3 (permalink)  
Old 09-12-06, 16:00
pkstormy pkstormy is offline
Moderator
 
Join Date: Dec 2004
Location: Madison, WI
Posts: 3,925
Sample Report

Here's a sample reporting system. I'm guessing if you're getting prompted for a date again, it's either not defined with the same name, you're referencing the field verses the value (i.e. me.mydate verses me!mydate) or it can't find it in the report.
Attached Files
File Type: zip SampleReportingSystem.zip (1.29 MB, 22 views)
__________________
Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On