Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query Runs for report not DAO
Message
De
08/12/1999 17:32:05
 
 
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00297898
Message ID:
00300645
Vues:
20
>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
Fil
Voir

Click here to load this message in the networking platform