0

I'm dealing with a Dlookup malfunction, and I've tried everything I can think of with no success.

So I have a combobox that has the ID and grade name as columns. The ID is numerical while the grade name is a mixture of numbers, letters, and a dash. It's trying to pull a decimal from the table to display on the form. I have no problem doing this IF the ID column is bound as opposed to the grade name.

I currently have

=DLookUp("[AD Max]","Grades New","[ID] =" & [Combo24])

which works if the ID column is bound and stored in the table.

However, if the grade name (e.g. B130-2380) is bound, then the field blinks and says #error.

I've tried

=DLookUp("[AD Max]","Grades New","[ID] ='" & [Combo24] & "'")

with no success, and

=DLookUp("[AD Max]","Grades New","'[ID] =" & [Combo24] & "'")

doesn't work either.

Can someone figure out what I'm doing wrong and give me some suggestions? Thank you.

AHeyne
  • 3,377
  • 2
  • 11
  • 16
  • When you bind the `Grade Name` to the combo box, why do you still use `ID` to search in? I expect you have a column `GradeName` in the table `Grades New`, so I think it should be `"[GradeName] ='" & [Combo24] & "'")`. Although I don't understand why you want to go from `ID` to `GradeName` anyway... – AHeyne Feb 24 '20 at 14:47
  • Thanks you! I thought the only way to search was with the key. I'm a novice so this opens up a lot of doors for me. – Chris Jahnke Feb 24 '20 at 16:25

0 Answers0