Link to home
Start Free TrialLog in
Avatar of kjena
kjena

asked on

problem in passing parameters to the report.

Dears,

I'v a problem in passing parameters into the report. i wrote down query in Dataenvironment as passing the item_id like this.
SELECT Date_of_purches, item_Id, SerialNo, supplier,
    Issuedfor
FROM Stock_Detail
WHERE (item_Id = ?)
ORDER BY SerialNo

then pass the parameter like this
    str = Combo1.Text
    DataEnvironment1.command1(str)
    DataReport1.show

when i run the programm it print only one time for perticular selecter item from combo box.but if second time select 4 another item or even same item it wont print. giving error like "operation is not allowed when the object is open!"
can u plz anyone give better solution 2 over come this.

jena..
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of joyful88
joyful88

to get rid of your object open error write down this:

if DataEnvironment1.rscommand1.State=adStateOpen then DataEnvironment1.rscommand1.Close

** you are closing the recordset of the command, not the command itself
    write this before you call your command.



Points to emoreau
Moderator, my recommended disposition is:

    Accept emoreau's comment(s) as an answer.

Dan Rollins -- EE database cleanup volunteer