View Full Version : Dcount gets value from combobox


BrainDead
09-05-2001, 08:36 AM
I have a txtbox with the control source as the following:

=DCount("location","domainfacts","location = '" & [me].[ccfind] & "'")

This is so that a user can select a country from the combobox "ccfind" and then the amount of times that country appears in the field location will be displayed in the txtbox.

I get !value with the above code.
If I use the code:

=DCount("location","domainfacts","location = '[me].[ccfind]'")
I get no error, and just the value "0"

Can someone point me in the right direction...

BrainDead... "The feeling you get after staring at your computer all day"

Howlsta
09-05-2001, 08:48 AM
Try this:

=DCount("[Location]", "domainfacts", "[Location] = '" & Me.ccfind & "'")

BrainDead
09-05-2001, 08:53 AM
Howlsta....

I get the same error as above, and the me.ccfind automatically reverts back to [me].[ccfind]

Any other suggestions???

Thnx

Howlsta
09-05-2001, 09:29 AM
Sorry, I should have realised it might do that. I just tried to see if I could do it with some of my data, but VB didn't like it.

Rich