G
Guest
Hi Everyone.
I'm having a small problem with my code. Perhaps someone can advise what I
am doing wrong??
All data is entered through a form. Users utilize several combo boxes which
pull repeatitive info from various tables. One combo box is based on the
MaterialCostTable which contains 3 columns - AutoNum, MaterialType and
CostPerFoot.
When the MaterialType is selected from the form's combo box, I want to pull
the appropriate CostPerFoot associated with the MaterialType. I used the
following code (on exit) listed at the end of this msg. A cost does show
up, but always displays $1.00, instead of the correct amount. What am I
doing wrong?
***********************************************
Private Sub MaterialType_Exit(Cancel As Integer)
Dim varCostPerFoot As Variant
varCostPerFoot = DLookup("CostPerFoot", "MaterialCostTable",
"MaterialType =[MaterialType] ")
If (Not IsNull(varCostPerFoot)) Then Me![CostPerFoot] = varCostPerFoot
End Sub
************************************************
Thanks in advance for any assistance!
Karen
I'm having a small problem with my code. Perhaps someone can advise what I
am doing wrong??
All data is entered through a form. Users utilize several combo boxes which
pull repeatitive info from various tables. One combo box is based on the
MaterialCostTable which contains 3 columns - AutoNum, MaterialType and
CostPerFoot.
When the MaterialType is selected from the form's combo box, I want to pull
the appropriate CostPerFoot associated with the MaterialType. I used the
following code (on exit) listed at the end of this msg. A cost does show
up, but always displays $1.00, instead of the correct amount. What am I
doing wrong?
***********************************************
Private Sub MaterialType_Exit(Cancel As Integer)
Dim varCostPerFoot As Variant
varCostPerFoot = DLookup("CostPerFoot", "MaterialCostTable",
"MaterialType =[MaterialType] ")
If (Not IsNull(varCostPerFoot)) Then Me![CostPerFoot] = varCostPerFoot
End Sub
************************************************
Thanks in advance for any assistance!
Karen