Lobster1071
Registered User.
- Local time
- Yesterday, 22:45
- Joined
- May 18, 2008
- Messages
- 23
I’m attempting to obtain a value from a field within a query. However, the field will vary based on selected info from a form. Yes, I know this is vague, but I’ll given an example below. This may not even be the best way to do this, so any suggestions would be appreciated.
What would really solve my problem is trying to insert a field name contained within a field. I know FoxPro had a “&” command which is called a “macro substitution”. This would resolve my issue I believe, but Access doesn’t seem to have an equivalent command.
Example:
A form has 3 selections, all with fixed values that a user must choose (either via a radio button, or combo box)
Form1.text1 (Choices are Blue or Red)
Form1.text2 (Choices are AB or CD)
Form3.text3 (Choices are Cat or Dog)
Based on the info from the form, that is the column I would like displayed in the query. Basically, one field in the query will be a variable based on the form selections.
The query (and table of course) will have the fields 8 different fields which will be “Blue_AB_Cat”, “Blue_AB_Dog”, “Blue_CD_CAT”, “Blue_CD_Dog”, etc…
I simply would like to have a column in the query that shows the data based on the selection in the form.
I know this is incorrect, but if one column in the query could say…
[Form1.text1]&”_”& [Form2.text2]&”_”& [Form3.text3]
…that would be essentially what I am looking for. The three choices on the form becomes the actual field name.
Thanks
What would really solve my problem is trying to insert a field name contained within a field. I know FoxPro had a “&” command which is called a “macro substitution”. This would resolve my issue I believe, but Access doesn’t seem to have an equivalent command.
Example:
A form has 3 selections, all with fixed values that a user must choose (either via a radio button, or combo box)
Form1.text1 (Choices are Blue or Red)
Form1.text2 (Choices are AB or CD)
Form3.text3 (Choices are Cat or Dog)
Based on the info from the form, that is the column I would like displayed in the query. Basically, one field in the query will be a variable based on the form selections.
The query (and table of course) will have the fields 8 different fields which will be “Blue_AB_Cat”, “Blue_AB_Dog”, “Blue_CD_CAT”, “Blue_CD_Dog”, etc…
I simply would like to have a column in the query that shows the data based on the selection in the form.
I know this is incorrect, but if one column in the query could say…
[Form1.text1]&”_”& [Form2.text2]&”_”& [Form3.text3]
…that would be essentially what I am looking for. The three choices on the form becomes the actual field name.
Thanks