Click to See Complete Forum and Search --> : HOW TO: Passing a Value from a Form, to a Report.


CheevyBoy
September 22nd, 2010, 11:45 PM
Here is my problem in pictures and the best decription i can give.

This is Form 1 - it has data bound from a local database created in SQL server.

http://i22.photobucket.com/albums/b3...s050/form1.jpg

And this is my report

http://i22.photobucket.com/albums/b3...050/report.jpg

What i want to do is, through the button on form 1, take whatever data is chosen by the user in the textboxes, through to the report that opens on form 2. So it looks like the below:

http://i22.photobucket.com/albums/b3.../processed.jpg

How do i do this?

Much thanks in advance.

carlsaiyed
September 23rd, 2010, 08:53 AM
Sorry, your pictures do not seem to work.

CheevyBoy
September 23rd, 2010, 07:07 PM
Oh Sorry.

Basically there was a form, with 3 databound textboxes from my database.
Then a button.

I want to make this button, open up a form that has a report in this form.

The button should be able to pass whatever values are in the textboxes, over to the corresponding textboxes on the form.

My question is how? Is ther code that has to go under the report load? or do you have to make parameters and pass them, and how?

Much thanks in advance,
Stergios.

carlsaiyed
September 23rd, 2010, 10:22 PM
This may help you:

http://www.vcskicks.com/data-between-forms.php

I'll shortly try to post a ZIP containing a project that demonstrates this.

carlsaiyed
September 23rd, 2010, 10:56 PM
A VS2008 solution is attached to this message demonstrating passing values between windows forms. Not sure if this will help.