VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
pls help me with teh following problem
i have written a pice of code, how shuld i define stQueryAuslauf if the
variabe should present the output of an query (eiter there is any or none)?

Dim stQueryAuslauf as Variant
....
If lstEinkauf.Selected(12) Then
If stQueryAuslauf = 0 Then
If MsgBox("Text?", vbYesNo) = vbYes Then
DoCmd.OpenForm ("AuslaufArt_1")
End If
Else
DoCmd.OpenForm ("AuslaufArt_2")
End If
End If
Thanks
 
You can use DCount for that purpose. DCount("*","qryAuslauf") will
return the number of records in qryAuslauf--a select query. So,

DCount("*","qryAuslauf")>0

will be the test in place of stQueryAuslauf

Mind you, the prefix 'st' is mostly used to indicate a String type
variable. You declare it as Variant, and use it as Boolean.

[OT] you will not have done this on purpose, but the spelling
beautifully reflects an accent ;-) liebe Gruesse
 
Back
Top