Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with public types

Status
Not open for further replies.

Craftor

Programmer
Feb 1, 2001
420
NZ
Hi everyone

I am having a bit of a problem with one of my ideas:

What i want to do is set up a program that will allow a user to create customised documents based on a generic template that substitutes fields with specific values. All this is fine until here but I have now hit a snag.

What I need is for my app to pass a variable back to a public type so that i can have a generic query running with little or no hard coding - something like:

Public ColRec as Collection_Record 'the public type

strVarName = AmountOutstanding 'result of a query

strField = ColRec. & strvarname

It gives me an error saying "Expectd identifier or bracketed expression"

I have tried everything - any help would be MUCH appreciated!!
 
You can't simply append the property to the object as a though it were a string. The compiler will have no idea what you are trying to do. Try using the CallByName function instead. - Jeff Marler B-)
 
strField = ColRec. & strvarname

Since colRec is a collection what you can do is reference it with an index. Try something like ColRec(x) where x is the index. You will need someway to track what the index is pointing to so you might also check ColRec(x).name for instance.

Good Luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top