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

need advice with recordset / query

Status
Not open for further replies.

micky500970

Programmer
Jul 9, 2004
81
0
0
GB
Hello,

Please bear with me if this does not make sense :O)



code snippet behind combo box

ssqltest = "select category,make,model,serialno,stationno,details,location,warranty,warrantyleft,purchased,supplier from qryequipment WHERE location = " & "'" & Cblocation.Text & "' Order by location asc"


When i click on a location it Pumps the relevant data from specified location into Mshflexgrid - this works fine.



----------------


Ok, this is hard to explain so here goes. Currently for reports I am dumping data from a query in to Excel. This works fine if I use a qry from access.


excel sub is called when i hit the print button

excel sub

strSelect = "SELECT location,category,make,model,stationno,serialno FROM " & strstring

BTW, strstring = qryinventory (this resides in an access table)


now, when i select a location from the combo box above, the data for that location is displayed in the flexgrid. if i press the print button i would like to print out the data i see and not all the data in qryinventory.

so, I thought about doing this:


strstring = ssqltest

naturally it did not like it. Where are the results of the ssqltest information stored? is it stored in the recordset?
I have used the variable RS for my recordset. (Set rs = New Recordset)

Set MSHFlexGrid.DataSource = rs

any help / guidance is much appreciated

cheers

mick
 
hi,

just an update. i solved my problem by using the "getstring" method.

Cheers

Mick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top