Hey guys. I've been having problems getting Dlookup to work. I'm trying to create dynamic lables for buttons on a form. The source for the lables would be a table named MainMenu. After racking my brain for hours, I came up with this bit of code:
=[Locations].[Caption]=DLookUp("[Caption]","[MainMenu]","[ID]=1")
Locations is the name of the button object. Caption is the name of the field in the table i want to copy from and the table's name is, again, MainMenu. I want to copy from the first record for that button so I put Id=1 as the criteria. I entered this code under the form's OnLoad event handler. I selected expression builder and typed it in there. I checked everything ten times already. I'm convinced my syntax is correct as per the microsoft access help website. I've with and without the brackets so I dont think thats the problem. For the life of me, I cannot figure out why this is not working! Please help. Thanks in advance.