G
Guest
I have a text box that inserts a transaction amount into a Table on
double-click.
Private Sub txtTransaction_DblClick(Cancel As Integer)
DoCmd.RunSQL "insert into Manual (trans_amt)values _
(Forms![frm_NPC]![txtTransAmt])"
MsgBox "Amount entered", vbOKOnly
End Sub
I had "hard coded" to fields in the Manual table: cost_center and block. Now
it turns out we want to select that information from another table, call it
FinancialInfo. I have placed a combo box on my form to select the cost_center
from the FinancialInfo table, but I want the code now to insert not only the
trans_amt value on double click, but also the selected cost_center from the
form combo box (cboCC), and the block from the FinancialInfo table
corresponding to the selected cost_center (cboCC).
I tried to use DLookup, but I'm not quite sure how to incorporate both the
RunSQL insert and DLookup to do what I want. Can anyone give me some advice?
double-click.
Private Sub txtTransaction_DblClick(Cancel As Integer)
DoCmd.RunSQL "insert into Manual (trans_amt)values _
(Forms![frm_NPC]![txtTransAmt])"
MsgBox "Amount entered", vbOKOnly
End Sub
I had "hard coded" to fields in the Manual table: cost_center and block. Now
it turns out we want to select that information from another table, call it
FinancialInfo. I have placed a combo box on my form to select the cost_center
from the FinancialInfo table, but I want the code now to insert not only the
trans_amt value on double click, but also the selected cost_center from the
form combo box (cboCC), and the block from the FinancialInfo table
corresponding to the selected cost_center (cboCC).
I tried to use DLookup, but I'm not quite sure how to incorporate both the
RunSQL insert and DLookup to do what I want. Can anyone give me some advice?