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

Selecting from a table dependent on a VB variable

Status
Not open for further replies.

eamonskelly

Programmer
Jun 14, 2001
11
GB
I have connected a report to VB via OLEDB to a SQL Server 2000 database. I have created a table which contains the necessary values, which is populated with the userId of the individual who has entered the fields. At the moment my report brings back all fields independant of this userID, how can I get it to filter by a certain userID passed from VB code. I have created the connection to the database at design time, but included the following line to stop the 'server not yet been opened error':
Report.Database.Tables(1).SetLogOnInfo "ServerName", "DatabaseName", "UserName", "Password"
Is there a way to do a select based upon the userID, passed from VB and place this in the report. I can do it via unbound fields, but this doesn't allow me to add groups.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top