PDA

View Full Version : Pass a variable from vb to access



ciberwritter
03-02-2006, 06:44 AM
Hello .
I have have a form e a Vb aplication, in this form i show a datagrid with all th records in a table.

My database is access, inside I created a report that must receive the id of the record to show the data related to the record.

On the form i have a print button, wich on clik it must open the report in access with the data from the record selected on the data grid.
Does anyone knows how can i pass the id of the record selected in the data grid to the query in access?

Thanks for the help.
Alberto Almeida

OBP
03-07-2006, 05:25 AM
Hello, I am sorry no one has responded before this, You do not need VB to pass the ID to the report. You can do this in the Report's query in the criteria row.

XLGibbs
03-08-2006, 05:22 PM
Why would you not just set up a report in the VB program, and execute the SQL for the report from the VB program. Access can simply be the container for your data...

passing the variables as part of the SQL statement is relatively simple.

Likewise, setting up a cntinuous form in Access is just as easy, in which the Report in Access can use the form control for any necessary filters..

Seems laborious to have both VB and Access performing functions available to both...makes more sense to have the front end contained in one program,,, be it VB or Access.

ciberwritter
03-12-2006, 04:08 PM
Hi. Thanks for the help.

I solve the problem doing un insert in a table with the selected record id, and then open the report with that record id.
best regards to all.