This may be the completley wrong way of doing things but I've manually created a lookup table with the field names as the list, the table headings won't change; eg
Main Table (tblMain)
Autonumber ID ¦ cat_guidance_1 ¦ cat_score_1
01 ¦ yes ¦ Yes
02 ¦ no ¦ Yes
Lookup table (tblTitles)
Autonumber (ID) ¦ Field Name(Heading) ¦ Easy to read field name(Title)
01 ¦ cat_guidance_1 ¦ Guidance
02 ¦ cat_score_1 ¦ Scores
etc
In the form I've created a combo box (cbotop1) (0cm;0cm;2.544cm) which uses
SELECT tblTitles.ID, tblTitles.Heading, tblTitles.Title FROM tblTitles;
Next to each combo box I've got a text box that counts the amount of fields that equal a certain criteria.
Say I selected Guidance in the Combo how do I get the expression to pull the field name from the combo box and count:
doesn't work.
How do I make it work like
Thanks
Main Table (tblMain)
Autonumber ID ¦ cat_guidance_1 ¦ cat_score_1
01 ¦ yes ¦ Yes
02 ¦ no ¦ Yes
Lookup table (tblTitles)
Autonumber (ID) ¦ Field Name(Heading) ¦ Easy to read field name(Title)
01 ¦ cat_guidance_1 ¦ Guidance
02 ¦ cat_score_1 ¦ Scores
etc
In the form I've created a combo box (cbotop1) (0cm;0cm;2.544cm) which uses
SELECT tblTitles.ID, tblTitles.Heading, tblTitles.Title FROM tblTitles;
Next to each combo box I've got a text box that counts the amount of fields that equal a certain criteria.
Say I selected Guidance in the Combo how do I get the expression to pull the field name from the combo box and count:
Code:
=DCount("[ID]","[tblMain]"," '" & Forms!frmOrsearch!cbotop1 & "' = -1")
How do I make it work like
Code:
=DCount("[ID]","[tblMain]"," [cat_guidance_1] = -1")
Last edited: