S
Stuart McGraw
I asked this in an different MS Access newsgroup without much
success so I thought I would try here.
I am looking for a VBA "format" or "template" function, that is,
a function that takes a format string and a varying number of
arguments, and substitutes the argument values into the format
string as specified in the format string. For example
fmt("this is $1 format string. arg2 is $2", "short", 3)
would return the string
"this is short format string. arg2 is 3"
Now, the above is easy to write and I have done so. What I want
is something similar that also has iterating and conditional abilities.
For example if 'rs' is a recordset (or array variable) with 3 records
and the "iterate" format spec is "<$", "$>" then
fmt ("the members are $< $1!name($1!age), $>", rs)
would return
"the members are smith(23), wilson(37), dobbs(18), "
Of course I don't care much about the exact syntax used in
the format string, just that it has these capabilities in general.
Anyone know of anything like this (preferably free)? Several
hours of web searching did not turn up anything.
success so I thought I would try here.
I am looking for a VBA "format" or "template" function, that is,
a function that takes a format string and a varying number of
arguments, and substitutes the argument values into the format
string as specified in the format string. For example
fmt("this is $1 format string. arg2 is $2", "short", 3)
would return the string
"this is short format string. arg2 is 3"
Now, the above is easy to write and I have done so. What I want
is something similar that also has iterating and conditional abilities.
For example if 'rs' is a recordset (or array variable) with 3 records
and the "iterate" format spec is "<$", "$>" then
fmt ("the members are $< $1!name($1!age), $>", rs)
would return
"the members are smith(23), wilson(37), dobbs(18), "
Of course I don't care much about the exact syntax used in
the format string, just that it has these capabilities in general.
Anyone know of anything like this (preferably free)? Several
hours of web searching did not turn up anything.