Martin (Martin Lee) said:
Why this calculation VBA is not workable?
[Text1043] = DCount("[status]", "DLRINQIRY", "[status] = 'OK' and
[DLRNAME]=combo1125")
How to correct it ?
Because you have not explained what you have nor what you are trying to
accomplish, we can only guess. My guess would be that you are trying to use
a text value selected by the user in a ComboBox named combo1125 on a Form to
compare against the Field DLRNAME and that you want to find and store the
count of records meeting the criteria in a TextBox named Text 1043 and, if
so, for clarity, I'll use some extra statements
Dim strCriteria as String
strCriteria = "[status] = ""OK"" AND [DLRNAME] = """ & Me.combo1125 & """"
Me.Text1043 = DCount("[status]", "DLRINQIRY", strCriteria)
But, as I said, that's only a guess.
And, I'll add, it's the LAST TIME I am going to waste my time and energy
trying to GUESS what you are trying to accomplish when you post code or
question with no explanation of what you have and what you are trying to
accomplish and ask why it isn't working. For good suggestions on effective
use of newsgroups, please read
http://www.mvps.org/access/netiquette.htm.
Larry Linson
Microsoft Access MVP