Pass a record to a function?

rockies1

King Cobra
Local time
Today, 20:31
Joined
May 21, 2001
Messages
38
I have some code that opens a recordset and I want to perform tasks based on the data in the current record.

For example, if the field [CrCls] = A, I want to pass the entire record to the function named CClassA.

How can I pass the current record to that function?
 
Have you thought about sending each field as a ByRef variable?

You could send the entire Recordset

or

Set the current record as an Array that is passed

I think the easiest method would be the ByRef variables.
 
I've never used ByRef variables...

I opted to concatenate all the data from the record to a string with each field seperated by a pipe, |, and pass the string to the function.
 
This it not UNIX...

If you want to concatenate the contents of columns use this character: &

RV
 
I know it's not unix.

I concatenated the fields into a pipe-seperated string: field1|field2|field3

using strRecord = rst![Field1] & "|" & rst![Field2] & "|" & rst![Field3]

I use the pipe as the seperator as I know that my data will never have a pipe in it and can reliably find fields that way.
 
Without having tried it, can't you just step through your table one record at a time, and reference the fields directly? Piping it all through a text field seems a 90 degree sideways solution, IMHO.

David R
 
I do step thru it 1 record at a time, but I need to pass individual records to other functions depending on their contents.
 

Users who are viewing this thread

Back
Top Bottom