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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a Parameter from VB

Status
Not open for further replies.

gazza11

Technical User
Jan 12, 2003
46
AU
I am using a report loaded in VB as a .dsr. I have successfully used SQL queries within VB to populate the personal particulars fields on the report form. Each persons record is referenced by the database field Employee.EmployID.
I also have a subreport on the report in Details a (Section 5) and I have set up a parameter field in the subreport (PM-Employee.EmployID), value type number.
When the report is 'run' I get prompted for the EmployID variable and data is displayed correctly, however I cannot seem to pass the variable directly (without prompting). How do I write the code in VB to pass the parameter?
Can someone please assist.
 
Have u linked the subreport to the main via the employID field??

Parameter would not be needed in subreport if subReport is linked via this field.
 
Thanks for replying. I have kept looking at my problem and I have set up the subreport so that it is linked to the Main report Parameter field. I still get asked for the parameter when I run the report. When I enter the data all is correct. Just cannot work out the way to pass the parameter. I only have one parameter so I suspect it goes something like "Report.parameterfields(0) = ". Any ideas?
 
Well, an idea would be to remove the parameter from the subreport, and link the main to the sub via the employID field.

 
Thanks Tracey - I do not have a field parameter in the sub report. The sub report is linked to the main via the EmployID field.
However I have many personnel records and when I create the report I need to create for just one person at a time. The selection is based on the employID field which the user selects withing VB program. I have created a parameter within the report that asks for the employID field but I want VB to pass the parameter without the dialogue box asking. Sorry i was not clearer before.
 
oh, sorry, guess i misread.
VB code i cant help with......
sorry

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top