Hello:
I have a table, Orders, whose key field is OrderID. The Data Type is AutoNumber.
Another field in this table is ShipmentID
I want to display the record by using a Combo Box, whose RowSource is from a query, OrderListQuery, that limits OrderID to records that have not been shipped (ShipmentID Is Null)
OrderListQuery:
Code:
SELECT [Orders]![OrderId] AS Expr1, Orders.ShipmentID, Orders.ShipDate, Orders.LabelId, Orders.Quantity, Orders.OrderDate, Orders.DeliveryDate
FROM Orders
WHERE (((Orders.ShipmentID) Is Null))
ORDER BY [Orders]![OrderId] DESC;
Combo Box query is:
Code:
SELECT [OrderListQuery].[Expr1] FROM [OrderListQuery] ORDER BY [Expr1] DESC;
where Expr1 is OrderID.
OrderListQuery displays the desired data.
The Combo Box displays the desired OrderID data.
However, when attempting to populate the form using the record selected, it errors in that OrderID cannot be set because "control cannot be edited; it's bound to autonumber field "OrderID""
Form is set as Data Entry: No.
The record selected is OK, confirmed with:
Code:
Private Sub Combo27_AfterUpdate()
Debug.Print Combo27
End Sub
but I cannot get OrderID in the form to accept Combo27 value.
I believe I could write VB to select the record and update it but it seems like the form should be able to accomplish the same action more easily.
Hopefully, I'm missing something really dumb, but the hair color of my mustache is beginning to change to that on the top of my head- GRAY! (grin).
Thanks in advance.