G
Guest
Hi,
I am trying to prefill a textbox (txtBudget) with the budget value found in
the testquery table. I have two criteria : cost code and category which are
both filled in using combo boxes (cboCC and cboCat).
I'm trying the cboCat afterupdate procedure to update the textbox but my
code isn't working. help! thanks a lot.
here is the code:
Private Sub cboCat_AfterUpdate()
Dim CC As String
Dim Cat As String
Dim result
CC = cboCC.Value
Cat = cboCat.Value
result = DLookup("[Total_Estimate]", "[testquery]", "[Cost_Code]= ' " & CC &
" ' and [Category] = " & Cat)
txtBudget.Value = result
End Sub
I am trying to prefill a textbox (txtBudget) with the budget value found in
the testquery table. I have two criteria : cost code and category which are
both filled in using combo boxes (cboCC and cboCat).
I'm trying the cboCat afterupdate procedure to update the textbox but my
code isn't working. help! thanks a lot.
here is the code:
Private Sub cboCat_AfterUpdate()
Dim CC As String
Dim Cat As String
Dim result
CC = cboCC.Value
Cat = cboCat.Value
result = DLookup("[Total_Estimate]", "[testquery]", "[Cost_Code]= ' " & CC &
" ' and [Category] = " & Cat)
txtBudget.Value = result
End Sub