Jump to content

how to create a value list using field names


sarah97302

This topic is 7796 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

Is there a way to create a value list of either all field names in the database or all fieldnames on a certain layout? I have tried using the FieldNames function [i defined a calculated field as FieldNames( "BargSurveys" , "" ) where BargSurveys is the name of my database], but this gives me no result. And even if that worked, I would still just get a list of all the field names in that field, but it wouldn't allow me to create a value list.

any ideas?

Link to comment
Share on other sites

Probably because the FieldNames() function is unstored.

If it's the field names you want, why not juat make a custom value list and type them in by hand? After all, the field name won't change very often.

Link to comment
Share on other sites

Create an file Fields.fp5 for this purpouse with following structure:

FileId FileName LayoutId LayoutName FieldsNamesCalc multikey

so you'll have one record for every layout for every file you need to document (or whatever else you are trying to achieve)

Now field FieldsNamesCalcs should be calculated as following:

Case(FileName&LayoutNames,FeldNames(FileName,LayoutNames), FeldNames(FileName,LayoutNames))

result text calculation indexed

whilst the multikey should be

FileID & " " & LayoutID

Now in file where you need those values define fields:

gFile, gLayout, multikey=gFile & " " & gLayout

also define two relationships:

FileRel::gFile-->FileID

LayoutRel::multikey-->multikey

Fianly define value lists you'll need:

list "Files" as use values from field FileID also display value from field FileName from file Fields.fp5

list "Layouts" as use only related values from relationship "FileRel" from field LayoutID display also values from field LayoutName

List "Fields" as use only related values from relationship "LayoutRel" from field FieldNamesCalc

HTH

Dj

Link to comment
Share on other sites

  • Newbies

Hi. Thanks for your post. I think I got most of it, but the one part that doesn't make sense to me is how to define the calculation for the field FieldNamesCalc in Fields.fp5.

In your post you said to calculate it as follows:

Case(FileName&LayoutNames,FeldNames(FileName,LayoutNames), FeldNames(FileName,LayoutNames))

And I am just not sure if you meant to define it verbatim [ie, when you write 'FileName&LayoutNames', you are referring to the field called FileName and then an "&" and then the field called LayoutName], or whether you mean for me to substitute in some actual names of files and layouts that I am using. I am confused.

Could you give me an example of the correct calculation for FieldNamesCalc if I am trying to create a value list for fields which appear on a layout called "BargSurveyEntry" in a file called "BargSurveys"?

Thanks for your help

Link to comment
Share on other sites

This topic is 7796 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.