M
Max Moor
Hi All,
Here is a code snippet..
rstTable.Open "tblPlumbers", CurrentProject.Connection, _
adOpenKeyset, adLockOptimistic, adCmdTableDirect
rstTable.MoveFirst
Do
If (rstTable!idxContact = lIdxContact) Then
rstTable!idxContact = cUndefined
rstTable.UpdateBatch
End If
rstTable.MoveNext
Loop While Not rstTable.EOF
rstTable.Close
I'm searching for the index "lIdxContact" in a number of tables, and,
if found, changing it to "cUndefined". This is to make these references
point to something before deleting the underluying contact.
I have to do this in 5 tables, so want this to be a procedure. I see
that I can pass the name of the table to it as a string. How do I pass in
the reference to the field of the table I'm testing? It's not idxContact
in all of them.Is there a way to pass a field name, such that it can be
used in an "If" like this?
Here is a code snippet..
rstTable.Open "tblPlumbers", CurrentProject.Connection, _
adOpenKeyset, adLockOptimistic, adCmdTableDirect
rstTable.MoveFirst
Do
If (rstTable!idxContact = lIdxContact) Then
rstTable!idxContact = cUndefined
rstTable.UpdateBatch
End If
rstTable.MoveNext
Loop While Not rstTable.EOF
rstTable.Close
I'm searching for the index "lIdxContact" in a number of tables, and,
if found, changing it to "cUndefined". This is to make these references
point to something before deleting the underluying contact.
I have to do this in 5 tables, so want this to be a procedure. I see
that I can pass the name of the table to it as a string. How do I pass in
the reference to the field of the table I'm testing? It's not idxContact
in all of them.Is there a way to pass a field name, such that it can be
used in an "If" like this?