Comparing Variants

J

jody

I have a lookup statement returning the value "H" to a
variant field. When I use strcomp to compare this to
another variant or string containing "H", it won't return
a match i.e. 0. How can I compare the lookup variant to
value "H" ?
 
K

Ken Snell

You could try wrapping the DLookup function with CStr to cast it as a
string:

If "H" = CStr(DLookup("....etc.")) Then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top