For...Each question

L

Larry Hodges

Hi everyone,

Running A2k...

I have a form with a cmd button on it that will fire the code. There is
also a subform on it displaying multiple records. I want to iterate though
all the records being displayed on the subform and update the data. For
example, I have a date field on the main form. When the cmd button is
clicked on the main form, I want another date field in all the records on
the subform to be set to that value.

This is what I have, but can't get to work:

Dim Hist1Date, HeadID
Dim rst As Recordset
Set rst = frmRouteTicketCloseLocationSubform.Form.Recordset

For Each HeadID In rst

'Move History data to make room for current data.
frmRouteTicketCloseLocationSubform.Form!Hist1Date =
Me.ActualCompletionDate

Next

Any help would be appreciated...thanks in advance.

-Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top