Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report with parameter from form

Status
Not open for further replies.

simma

Programmer
Sep 11, 2001
398
US
Hello
Im trying to bring up report with one of field criteria comming from form.I have following code.But whenever I run the code input box opens up asking for parameter.Please let me know what Im doing wrong.
Thanks

Dim stDocName As String
Dim stLinkCriteria As String
Dim strarea As String
stDocName = "RptDefault"
cboarea.SetFocus
strarea = cboarea.Text
DoCmd.OpenReport stDocName, acPreview, , "Item_Source = " & strarea & ""
 
Use the Value property (or no property) rather than the Text property. If the value truly is a string value than modify your code to:
DoCmd.OpenReport stDocName, acPreview, , "Item_Source = """ & strarea & """"

If you are still getting an input box, tell us what the caption is. I assume [Item_Source] is a field in the record source of your report.

Duane
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top