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

what is irow 1

Status
Not open for further replies.

newprogamer

Programmer
Sep 22, 2004
107
US
Does any one know what irow does?

'open the record set and search for contents in the combo box
Set Rs = db.OpenRecordset("SELECT * FROM tblFileName WHERE Manufacturer = " & cboManufacturer.Text)

Rs.MoveFirst
irow = 3
Do While Not Rs.EOF
Cells(irow, 1) = Rs("Quoter")
irow = irow + 1
Rs.MoveNext
Loop
 
Hi,

Cells(irow, 1) = Rs("Quoter")

assigns the value in field Quoter in the Rs recordset object, to the cell in the ActiveSheet in COLUMN 1 (A) ROW irow, which initially is 3, and incriments by 1 with each row in the recordset, until the recordset is out of rows.

Skip,

[glasses] [red]Be advised:[/red] Researchers have found another Descartes trueism, "Cogito ergo spud."
"I think; therefore, I YAM!
[tongue]
 
Thanks,

Is there a way to pull the fields out of an acess table and put them on the same row but in different columns? For instance Column A = Quoter, Column B= Date, Column C = Manufacturer, Column D = Model. Then, do this until all the data from the recordset has been copied to excel?
 
All you gotta do is use Data/Get External Data in Excel.

You can query DIRECTLY into your Access Database/Table(s) and return the recordset into Excel -- NO CODE AT ALL!

Skip,

[glasses] [red]Be advised:[/red] Researchers have found another Descartes trueism, "Cogito ergo spud."
"I think; therefore, I YAM!
[tongue]
 
Thanks, it sounds easy. But, I don't understand how to return the recordset into excel. I would appreciate any help you can provide. Thanks in advance!
 


Menu Item

Data/Get External data/New Query -- Access files -- you Access db -- your table(s) -- next, next, next, check option button for Edit Query, finish.

In the Query Editor, drag the fields you want into the grid, add criteria etc,

then File/Return data to Excel

clock OK

and you have your resultset displayed in your Excel worksheet.


Skip,

[glasses] [red]Be advised:[/red] Researchers have found another Descartes trueism, "Cogito ergo spud."
"I think; therefore, I YAM!
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top