Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

problem in passing parameters to the report.

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

789 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