Skip to main content
Inspiring
June 6, 2007
Question

Dynamic forms using dynamic column names

  • June 6, 2007
  • 3 replies
  • 349 views
I have a table with columns such as level_1, level_2, etc. until level_11 and I have another table with level_id and description, i.e. for level with id = 1 the description could be 'Crawl.' Id 2 could be 'Walk' etc.

I'm trying to make a checklist so people can mark when they've done things on the checklist, and then upload those values to the appropriate tables to store the information so it's all still there when they go back to check off a new skill.
I can't figure out how to make the column names in the form dynamic.

I've played around with the formatting and still can't quite get it. I've tried evaluate(queryname.level_#level_id#), queryname.label, a bunch of other ones, and I can't seem to get it to work.

Thanks for the help!
This topic has been closed for replies.

3 replies

Inspiring
June 6, 2007
It would be a lot easier if you normalized your database.
Inspiring
June 6, 2007
Get to know CF's structure / array notation. This comes in very handy when dealing with queries and form fields.

- Form.myFieldName can also be referenced by Form["myFieldName"]
- MyQuery.myField can also be referenced by MyQuery["myField"][rowNumber]

Anything in the above example surrounded by quotation makes can be made dynamic by just adding in a cf variable surrounded by pound signs:

get_dealer_completion["level_#level_id#"][1]
June 6, 2007
Try evaluate("queryname.level_#level_id#")