0

I have a very basic function that is to return symbols such as "=", ">","<",">=", and "<=" and it is only returning a null value. any Ideas?

Function Lookup_Symbol(search_Name As String) As String
    Lookup_Symobl = DLookup("[Symbol]", "[Search_Names]", "[Search_Name]= '" & search_Name & "'")
End Function

when I do a Debug.print DLookup("[Symbol]", "[Search_Names]", "[Search_Name]= '" & search_Name & "'") it will return =

4
  • How are you verifying, that the function does return null? Commented Jul 29, 2015 at 12:00
  • I guess I'm not, I just assumed that it was, it may only be "" Commented Jul 29, 2015 at 12:10
  • "Lookup_Symbol" and "Lookup_Symobl" and not the same. Commented Jul 29, 2015 at 13:17
  • thank you everyone. got to love typos Commented Jul 29, 2015 at 15:52

1 Answer 1

1

Because you have misspelled Lookup_Symbol in your function. It should be:

Function Lookup_Symbol(search_Name As String) As String
    Lookup_Symbol = DLookup("[Symbol]", "[Search_Names]", "[Search_Name]= '" & search_Name & "'")
End Function

You would have been able to spot this much easier if you had Option Explicit at the top of the module; it would then have told you that the variable Lookup_Symobl is not defined.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.