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!

[b]Updating the Recordset [/b]

Status
Not open for further replies.

trystanhuwwilliams1

Programmer
Jan 7, 2003
44
0
0
GB
Hi, This should be fairly easy to answer. This is my code:


Code:
rs.MoveLast
tot = rs.RecordCount

For x = 1 To tot
With rs
.Edit
!Credit_Date = Null
.Update
rs.MoveNext
End With
Next x

Is it possible to replace the field Credit_Date with a variable?

Thanks,

Trystan
 
Thanks for you help Hap, but Access doesn't like the parenthesis around the variable name. I've also tried removing them without success.

I may have to try a different approach.


Trystan
 
Aha,

As long as you don't use an operator identifier, such as ! or . then Access will accept a variable as a substitute for the field name.
 
Have you tried this ?
MyFieldName = "Credit_Date"
rs.Fields(MyFieldName) = Null


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top