Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Generating dynamic output (text boxes?)

Status
Not open for further replies.

JulieS

MIS
Nov 23, 2000
48
CA
Hello,

I am calling a query from access (I pass ID as the parameter), but my problem is how to display the results when i'm not sure how many records it will return.

How can I display the output in VB so all the records will appear? I'm thinking i'd have to generate text boxes dynamically, but I am at a loss for how to do this.

Thanks,

julie
 
Julie,

I think that is what the DbGris(s) are for. VB has at least two and there are A LOT of third party suppliers whi have expanede the concept. It is the most 'popular' add on tool for VB.

If you set up a grid with a query as the recordsource, it will 'expand' to the size necessary to accomodate the records returned. It IS a little retard with respect to the column headings, but the data is generally just fine.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Hi Julie.

I think MichaelRed is right - creating text boxes will be a lot of work when the grid can display your output for you. ...

FYI : You can find out the number of records returned using the RecordCount property.

eg
Dim rsMyData as RecordSet
Set rsMyData = dbMyData.OpenRecordset("MyTable", dbOpenSnapshot)
MsgBox "number of records: " & rsMyData.RecordCount
 
Jackie,
Using DAO like this will only give you an accurate recordcount (using rs.RecordCount) after you have moved to the last record.
Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top