[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

Creation of wordpad

I am having two queries related to V.B6.0

1)I am creating my own Wordpad in VB.I want to add the Ruler in my wordpad as it is there in original
wordpad but i dont find any ruler control in components option in VB. How do I put that control in my

2)Secondly I have created a datatreport in VB now i want that before executing the datareport it should
first flash the screen asking me about the department no. for which i want to execute the report.I have
created a form in std.exe ehich ask me about deptno but now i dont know how to send this deptno to dataenvironment
and how to execute datareoprt for that particular dept.Kindly send me the code for this.
1 Solution
Hi Meghna

For your query 1 you could create your own control or simply use the picture box and the line and print methods to achieve the ruler bar.

As for your query - I think you want to pass a parameterized to the query you are using in the data report.

IF yes - get a look at the PARAMETERS object in ADO or simply create a query string based on the parameter and use it in datareport at run-time.

Something like

mSql = "SELECT * FROM table WHERE deptno = '" & txtdeptno.text & "'"

assuming deptno is a text field. Make necessary changes to accomodate dates and numbers.
Instead of making your own form to get the dept number, you can use VB's InputBox function. Something like this:

Dim DN As String
DN = InputBox("Please Enter your dept number.")
If DN = "" Then
    'User canceled
    'Send your query
End If

You can use something like gajendra's code (I guess, I don't know about the data components) but pass DN instead of txtdeptno.text.
Hi meghana_as,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Split points between: hes and gajendra

meghana_as, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer
Per recommendation, force-accepted.

CS Moderator

hes: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20328909

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now