I hope someone can help me! I've spent all day trying to get this to work!!
I have a report menu that allows users to select specific options or all, view/print, etc. I have collected their selections and formatted them into this WHERE clause:
lsWHERE = "Assets.EquipmentType = '" & globalEquipmentType & "' and Assets.AssetOwner in " & _
lsAssetOwner & " and Moves.DateMoved between DateValue('" & [Forms]![ReportMainMenu]![FromDate] & "') and " & _
"DateValue('" & [Forms]![ReportMainMenu]![ToDate] & "') and " & _
"Moves.DateMoved In (SELECT TOP 1 DateMoved FROM Moves WHERE " & _
" SerialNumber = Assets.SerialNumber ORDER BY DateMoved desc) "
Then I have this statement:
DoCmd.OpenReport globalOption, lsMode, , lsWHERE
I can print the WHERE clause in a MsgBox and it looks just like what I want it to be. However, when I execute the query, it prompts me for the EquipmentType and AssetOwner. Any help is appreciated!
SCubed
I have a report menu that allows users to select specific options or all, view/print, etc. I have collected their selections and formatted them into this WHERE clause:
lsWHERE = "Assets.EquipmentType = '" & globalEquipmentType & "' and Assets.AssetOwner in " & _
lsAssetOwner & " and Moves.DateMoved between DateValue('" & [Forms]![ReportMainMenu]![FromDate] & "') and " & _
"DateValue('" & [Forms]![ReportMainMenu]![ToDate] & "') and " & _
"Moves.DateMoved In (SELECT TOP 1 DateMoved FROM Moves WHERE " & _
" SerialNumber = Assets.SerialNumber ORDER BY DateMoved desc) "
Then I have this statement:
DoCmd.OpenReport globalOption, lsMode, , lsWHERE
I can print the WHERE clause in a MsgBox and it looks just like what I want it to be. However, when I execute the query, it prompts me for the EquipmentType and AssetOwner. Any help is appreciated!
SCubed