I don't know anything about the structure of your db, but it would
seem very unusual to store information about a process in a employees
table. The first question I would ask is what is the nature of the
relationship between an employee and a process. For example, if
an employee can be assigned more than one process (at a given time
or over the course of their employment), and any given process can be
assigned to more than one employee, then you have a many-to-many
relationship and you need a junction table to manage it. The information
about which employees are assigned which processes would be stored
in this junction table, not in the employee or the process table.
So my first inclination would be to suggest that you should not be storing
the ProcessID in the Employees table to begin with. However, having said that,
if you need to loop through the records in a form, one method is to use the
RecordsetClone property. For example;
Dim i As Integer
With Me.RecordsetClone
'get an accurate record count
.MoveLast
.MoveFirst
'loop through the records
Do While Not .EOF
For i = 1 To .Recordcount
strSQL = "Update SomeTable Set SomeField = Something;"
CurrentDb.Execute strSQL, dbFailOnError
.MoveNext
Next i
Loop
End With
--
_________
Sean Bailey
"Opal" wrote:
> I have:
>
> Dim strQuery As String
>
> strQuery = "UPDATE EMPInfo " & _
> "SET ProcessID = " & Forms!subfrmZoneOrg1.ProcessID & _
> " WHERE EMPNumber = " & Forms!subfrmZoneOrg1.cboEMPNumber
> CurrentDb.Execute strQuery, dbFailOnError
>
> But that only takes care of the first item on the form.
>
> How can I loop through the remaining employees on the
> continuous form? Thanks!
>
>
|