Solved

problem in passing parameters to the report.

Posted on 2003-11-17
6
183 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 70

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 70

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

813 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