Posted on 2007-07-31
This is making me a little nuts. To update the records available in a combobox, I have a popup form with a listbox (LENDER_ADD) of available values. The user can doubleclick on the listbox to add the value to the underlying table and requery the combobox. That I have no problem getting to work. Before doing so, I run a query to check if the value has already been added. I use a DLookup to check the query results (this is what I've been using to test):
If (DLookup("[LENDERID]", "CHECK_LENDERID", "") = Me!LENDER_ADD) Then
MsgBox "Doesn't Work!"
(LENDER_ADD's value equals LENDERID)
The problem is that it always fails, even if the value exists in the underlying table. I get "Doesn't Work!" every time. For instance, lets say the LENDERID (Integer) is 150 and LENDER_ADD = 150, which I verfied by returning it in a MsgBox so I knew I had the right column set in the ListBox. Now, if I replace Me!LENDER_ADD with the number 150 it works. That tells me it must be an issue with the ListBox not being a number, but I don't see why and haven't been able to reformat it in a way that makes it work. And just for clarification, if I MsgBox LENDER_ADD before running the DLookup, it does return 150.