Right, so i have a table which hase pricing information, and i am trying to do a DLookUp in it to find the Unique ID (MixID) for a given Mix (Mixes).
So, i wrote a subroutine to do this and set values for me, but despite the huge number of DLookup's already in the whole project (well over 30-40) and they all work like charm.
This being the case i have check, and double checked the DLookUp to see if i can find any mistakes, but i can't seem to find any.
Here is the Code:
And here is the table which it should be looking through:
The majority of the textboxes which are referenced in this subroutine are part of a form which displays the table above. This form is then included in another form as a subform. The subroutine above is ran when a user double clicks on a field in the subform and passes one or two values back to the main form.
Can anyone see anything that i am missing?
So, i wrote a subroutine to do this and set values for me, but despite the huge number of DLookup's already in the whole project (well over 30-40) and they all work like charm.
This being the case i have check, and double checked the DLookUp to see if i can find any mistakes, but i can't seem to find any.
Here is the Code:
Code:
Public Sub SelectMix()
Dim MixIDVar As Integer
On Error Resume Next
If Not Mixes.Value = "" Then
'Pass the selected value to the quote mix
Form_PriceList.txtQuoteMix.Value = Me.Mixes.Value
'Get the numerical ID for the mix
MixIDVar = DLookup("MixID", "MixesPricing", "Mixes=" & Mixes.Value)
Form_PriceList.txtQuoteMixID.Value = MixIDVar
End If
On Error GoTo 0
End Sub
And here is the table which it should be looking through:
The majority of the textboxes which are referenced in this subroutine are part of a form which displays the table above. This form is then included in another form as a subform. The subroutine above is ran when a user double clicks on a field in the subform and passes one or two values back to the main form.
Can anyone see anything that i am missing?