Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Runs for report not DAO
Message
General information
Forum:
Visual Basic
Category:
Other
Miscellaneous
Thread ID:
00297898
Message ID:
00300484
Views:
23
Hi Igor,
Sure Here-It-Is
This "Main Tally" Query Works-
SELECT [Bar Code Manager].Printed
FROM [Bar Code Manager]
WHERE ((([Bar Code Manager].Printed)=No));

Private Sub Preview_Click()
On Error GoTo Err_Preview_Click
Dim DBS As Database, RST As Recordset
Dim stDocName As String, nokeep As Integer
Set DBS = CurrentDb
Set RST = DBS.OpenRecordset("Main Tally")
Form.txtCountPrint = "0"
Form.txtCountPrint = RST.RecordCount
If CInt(Form.txtCountPrint) > 0 Then
stDocName = "Manager Blue Card"
DoCmd.OpenReport stDocName, acPreview
. . .
Else
nokeep = MsgBox("No Records to Preview!", 0, "All Records already processed.")
End If
. . .
End Sub

"Main Tally" queries correctly manually not automatically when:
SELECT [Bar Code Manager].Printed, [Bar Code Manager].who
FROM [Bar Code Manager]
WHERE ((([Bar Code Manager].Printed)=No) AND (([Bar Code Manager].who)=Mid(Trim([CurrentUser]),1,4) & ".dat"));
Error: (at Set RST) Expected Parameter 1

Why?
The Report is based on Query with exact Where, no problem!

>Hi Edgar,
>
>May you post the code, so we could locate the problem?
>
>Igor
Edgar L. Bolton, B.S. B.B.A.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform