Solved

problem in passing parameters to the report.

Posted on 2003-11-17
6
177 Views
Last Modified: 2010-05-01
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..
0
Comment
Question by:kjena
  • 2
6 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 125 total points
ID: 9770221
0
 

Expert Comment

by:joyful88
ID: 9776295
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.



0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 10163603
Points to emoreau
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 10548617
Moderator, my recommended disposition is:

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

Dan Rollins -- EE database cleanup volunteer
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now