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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Posting query results in a datagrid

Status
Not open for further replies.

jason12776

Technical User
Nov 15, 2001
93
US
How would I go about posting the results of a query into a datagrid, as well as some text boxes? I want the datagrid to be in synch with all the text box fields.

What I have is a bunch of text boxes linked to my database. When I assign the datagrid to the same database conection as the text boxes, they will be in synch with each other.

Now, when I perform a search, I want the datagrid and text boxes to be in synch with the results from the query only. Is there an easy/not so easy way to do this?

Any assistance will be appreciated.

Cheers.
 
How are you performing the search?
Are you using the data control or a recordset object to update the grid?

At this point, it may be best to do the search based on a recordset clone of the object that the grid and text boxes are linked/bound to.

Set up the search dialog based on a recordset clone. Once the search is done, set the bookmark of the recordset clone to the bookmark property of the recordset object that the grid is bound to.

Dim rsClone as ADODB.Recordset

Set rsClone = datPrimaryRS.Recordset.Clone
'Or Set rsClone = rs.Clone

'now use the rsClone for the search dialog

'After the search is complete:
datPrimaryRS.Recordset.Bookmark = rsClone.Bookmark

[/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top