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

addressing a "cell" in a table, or, opposite of GetRows()? 1

Status
Not open for further replies.

netscamp

Technical User
Oct 3, 2003
19
0
0
US
I used GetRows to fill an array with the contents of a table, now, using vba, I'm doing some math, and want to put the results into the last column of the table, I know how to do it in an array, or in Excel VBA, but how in an Access table?
What is the name of the intersection of a row and a column,
how to address a specific field in a specific record, one wonders.


I couldn't find a command called PutRows.

Thank you.

 
As an addition to pellets you could use an update query.

However if you have to use VBA then I would use something similar to the code below.

Sub UpdateValues()
Dim recSet As DAO.Recordset
Dim intTemp As Integer

Set recSet = CurrentDb.OpenRecordset("TableName", dbOpenDynaset)

'Loop through the records in the table...
With recSet
Do Until .EOF
intTemp = .Fields("Field1_Name")

'Maths functions...
intTemp = intTemp + 1

'Add new value to another field in the table...
.Edit
.Fields("Field2_Name") = intTemp
.Update
Loop
End With

recSet.Close
Set recSet = Nothing
End Sub
 
the math I'm doing -

if the cell I'm in were called x,y - then the formula would be

x,y = (x-4,y-1 + x-4,y) - x-3,y - x-2,y

It's very spreadsheety.

and I would want to go down a column filling in each cell
with the values predicated on the prevous execution of the formula until I hit RowCount

 
I changed my strategy a bit, and I'm not looping down through the rows, just finding the first blank that needs a calculation. That part is working, but the update, based on your previous suggestion is not showing up, no error, but not updating for some reason.

Code:
With recset
recset.MoveFirst
For z = 1 To rowy
Move.Next
Next z

.Edit
.Fields("open_receivable") = rcvray(colx, rowy)
.Update

End With

Any to-be deeply appreciated hints ?
thanks,
Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top