micky500970
Programmer
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
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