When you receive this error, VBA is saying, "I couldn't do what you asked,
because I had to do something else first and that didn't work." It can be as
simple as needing to save the current record before being able to move
elsewhere.
In the context of DLookup(), the error means "I could not assign the return
value of the DLookup() because the attempt to lookup the value failed." That
happens if one of the 3 arguments is incorrect. For example, if you write:
MyVar = DLookup("MyField", "MyTable", "Field2 = 99")
but Field 2 is actually spelled with a space, you get this error. The
solution in this case is to correct the 3rd argument so it reads:
MyVar = DLookup("MyField", "MyTable", "[Field 2] = 99")
In short, you probably misspelled a field or table name, or referred to a
field that is not in the table.