clemensbarends
New member
- Local time
- Today, 23:55
- Joined
- Feb 17, 2010
- Messages
- 2
How can i get the value from a combobox to be used as the column that needs to be searched/counted in an already existing query?
I have a query with patient data: qryissuehealth. It has Idpatient (linking it to personal data) and several columns about complaint: "Shingles", "Coughing", "Diarrhoea" etc etc. I now want to build a form where a combobox drops down displaying these complaints. Next they are to be selected and a Dcount-function is to count these complaint:
I have tried this in almost every conceivable combination of []'s, ()'s and ""'s but it doesnt work.
Dcount ("[IDclient]![Dtblissuehealth]";"[Dtblissuehealth]"; "[combo4]=yes")
=DCount("[IDclient]![Dtblissuehealth]";"[dtblissuehealth]";""[combo4]"&!"[dtblissuehealth]""=Yes)
Note that the field [combobox4]![Dtblissuehealth] does not actually exist but needs to be filled in with the result from combobox4.
The bound column of combo4 refers to Dtblinserttable: a table where the bound column hold the wanted columnnames as text: [coughing]![Dtblissuehealth] etc. Or, in the above examples: [coughing]
I cant do VBA, have to work with ingenuity and stamina in the expression builder. I would like to keep it in expressionbuilder.
can you get the criterium-column in the dcount function to be filled with the result from a combobox?
Any workaround with an additional query is also welcome ofcourse.
Thank you!
I have a query with patient data: qryissuehealth. It has Idpatient (linking it to personal data) and several columns about complaint: "Shingles", "Coughing", "Diarrhoea" etc etc. I now want to build a form where a combobox drops down displaying these complaints. Next they are to be selected and a Dcount-function is to count these complaint:
I have tried this in almost every conceivable combination of []'s, ()'s and ""'s but it doesnt work.
Dcount ("[IDclient]![Dtblissuehealth]";"[Dtblissuehealth]"; "[combo4]=yes")
=DCount("[IDclient]![Dtblissuehealth]";"[dtblissuehealth]";""[combo4]"&!"[dtblissuehealth]""=Yes)
Note that the field [combobox4]![Dtblissuehealth] does not actually exist but needs to be filled in with the result from combobox4.
The bound column of combo4 refers to Dtblinserttable: a table where the bound column hold the wanted columnnames as text: [coughing]![Dtblissuehealth] etc. Or, in the above examples: [coughing]
I cant do VBA, have to work with ingenuity and stamina in the expression builder. I would like to keep it in expressionbuilder.
can you get the criterium-column in the dcount function to be filled with the result from a combobox?
Any workaround with an additional query is also welcome ofcourse.
Thank you!