I have a form called [BrakesExpress1QueryForm] where I have a text box [txtFrontRotors] that I want to put a Dlookup formula in the Control Source properties.
I am looking for the field [FrontRotorPart] from table [BrakePartsGroup] based on [AssetGroup]. In the table [BrakePartsGroup] is the field called [AssetGroup] which is a lookup to another table called [AssetGroups]. Because this is a lookup the data format is a number. So I am trying to match up [AssetGroup] on my form to [AssetGroup] in my table [BrakePartsGroup].
So here is my code that returns an #Error
So I thought maybe it's because it's a number data format, so I adjusted my code:
This now returns a value of 575.
Is my problem related to the data formats from my lookups in my table? Or am I just missing something simple?
I am looking for the field [FrontRotorPart] from table [BrakePartsGroup] based on [AssetGroup]. In the table [BrakePartsGroup] is the field called [AssetGroup] which is a lookup to another table called [AssetGroups]. Because this is a lookup the data format is a number. So I am trying to match up [AssetGroup] on my form to [AssetGroup] in my table [BrakePartsGroup].
So here is my code that returns an #Error
Code:
=DLookUp("[FrontRotorPart]","[BrakePartsGroup]","[AssetGroup]='" & [Forms]![BrakesExpress1QueryForm]![AssetGroup] & "'")
So I thought maybe it's because it's a number data format, so I adjusted my code:
Code:
=DLookUp("[FrontRotorPart]","[BrakePartsGroup]","[AssetGroup]=" & [Forms]![BrakesExpress1QueryForm]![AssetGroup])
This now returns a value of 575.
Is my problem related to the data formats from my lookups in my table? Or am I just missing something simple?