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

visual basic reports

Status
Not open for further replies.

irkle

Programmer
Mar 23, 2003
11
0
0
GB
i have a simple client-server database which allows users to input data using a form then search for records. the results of the search are displayed in a similar form to the input form, but an adodc control has been added so the user can scroll through the search results if more than one matching record is found. i would like to add a button which generates a data report so that only the current record which is being displayed is shown in the data report. so far i have a data envorinment and a data report with all the fields listed. i need code which looks at whatever record is currently displayed and only populates the data report with that record. thanks!
 
I dont use adodc but behind your button create a SQL statement that gets the current record from your DB and send it to the datareport.

strSQL = "SELECT Field FROM Table WHERE Field = '" & txtTextbox.Text & "'"

Then set the datareports DataSource = to the recordset.

the recordset will open the strSQL string.

There are more ways to do this, I am sure someone that uses the ADODC and binds there data to forms will be able to give you some more examples.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top