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

How do I edit a field in my table

Status
Not open for further replies.

avatarp

Technical User
Jul 3, 2002
22
CA
I have a table that I scan rows then,the columns to match a column header with a variable. Once the column has been found with correct header, I want to change the value of the cell in that row.

This is my sample With statement to do this:

With rsMyRS
.Edit
!EmailList = True
.Update
End With

EmailList is the column header and I am setting the value of this cell to be 'True'

This is my problem how do I do this with the column header name stored in a variable. I have to use a variable because I have many possible column headers. So I need something generic.

Thanks for your help.
 
try this:

If you know that the fieldname is EmailList use:

.fields("EmailList") = True

If the field name is stored in myStr use:

.fields(myStr) = True Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top