I am new to Access and VBA, and am having a problem getting a combo box to work as expected.
I have two tables:
tblInventoryTransactions
PK - TransactionID (autonum)
ProductID (int)
TransactionType (int)
etc
tblTransTypes
PK - TypeID (autonum)
TransactionName
Action
tblTransTypes is simply a lookup table that looks like:
1 Shipped Removal
2 NewPurchase Addition
3 CustReturn Addtion
etc
I am trying to create a form for inventory transactions, and I would like a combo box that drops down the values of tblTransTypes.TransactionName, and then populates tblInventoryTransactions.TransactionType with the corresponding TypeID.
If I simply set the RowSource of the Combo Box to tblTransTypes, or 'SELECT tblTransTypes.TypeID, tblTransTypes.TransactionName FROM tblTransTypes;' the list shows up as expected, but I can't actually select anything, which is understandable, because the lookup table should be static in this case.
If I go into design view for the RowSource query and add my tblInventoryTransactions, I have a relationship of tblTransTypes.TypeID -> tblInventoryTransaction.TransactionType, which adds an INNER JOIN to the SQL statement. Once the INNER JOIN is there, the combo box drops nothing, and will accept no input. I have tried reordering my fields in the query, but can't get this to do what I want.
How do I get a combo box to display values from the TransType lookup table, but insert the TypeID into my Transaction table?
Thanks
I have two tables:
tblInventoryTransactions
PK - TransactionID (autonum)
ProductID (int)
TransactionType (int)
etc
tblTransTypes
PK - TypeID (autonum)
TransactionName
Action
tblTransTypes is simply a lookup table that looks like:
1 Shipped Removal
2 NewPurchase Addition
3 CustReturn Addtion
etc
I am trying to create a form for inventory transactions, and I would like a combo box that drops down the values of tblTransTypes.TransactionName, and then populates tblInventoryTransactions.TransactionType with the corresponding TypeID.
If I simply set the RowSource of the Combo Box to tblTransTypes, or 'SELECT tblTransTypes.TypeID, tblTransTypes.TransactionName FROM tblTransTypes;' the list shows up as expected, but I can't actually select anything, which is understandable, because the lookup table should be static in this case.
If I go into design view for the RowSource query and add my tblInventoryTransactions, I have a relationship of tblTransTypes.TypeID -> tblInventoryTransaction.TransactionType, which adds an INNER JOIN to the SQL statement. Once the INNER JOIN is there, the combo box drops nothing, and will accept no input. I have tried reordering my fields in the query, but can't get this to do what I want.
How do I get a combo box to display values from the TransType lookup table, but insert the TypeID into my Transaction table?
Thanks