>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
[CurrentUser] doesn't seem to be fully qualified. Is this a field in the [Bar Code Manager] table?
Also, you can put the msgbox up in the Report_Nodata if the query does not return records. That way you don't have to check for the recordcount.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement