looping ...

  • Thread starter Thread starter jer
  • Start date Start date
J

jer

I am a newbie. I have a table in access which was
imported from excel. Now I want to add a column
(control) and add data based on data in other cells. In
excel this would be done via a do until loop. First is
this possible in access? Secondly, in exel I would use
something like

Dim cell As Range
Set cell = ActiveWorkbook.ActiveSheet.Cells(2, 1)

Do Until IsEmpty(cell.Value)

If cell > 25 Then
cell.Offset(0, 1).value = "Over Due"
else cell.value = "On Time"
End If
Set cell = cell.Offset(1, 0)
Loop
 
I hit send in error. Can anyone point me in the
direction where I might find examples of looping in access
TIA
jer
 
If the new field can be calculated strictly based on data in existing
fields, why add it? You can create a query that does the calculation as a
calculated value, and use the query wherever you would otherwise have used
the table.

If you're determined to add the field to the table, using an Update query is
almost always faster than using VBA code.
 
Thanks Douglas
jer
-----Original Message-----
If the new field can be calculated strictly based on data in existing
fields, why add it? You can create a query that does the calculation as a
calculated value, and use the query wherever you would otherwise have used
the table.

If you're determined to add the field to the table, using an Update query is
almost always faster than using VBA code.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)






.
 

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

Similar Threads


Back
Top