I am trying to build a form to verify a customer order.
The form will have a subform that, instead of being a form, will actually be a query called "Verify". The query will appear as an object in datasheet view, and allow users to edit the details (quantity, size etc.) of each item ordered.
I am running into problems here as I try to pass a VBA variable "OrderID" to the query as a parameter. Currently I have the query as an object in Access. I have thought about using DAO, but how would I source a SQL query generated by DAO to appear in datasheet view on the form?
It may be possible to do what you want with enough work.
The way I would do it it to keep it simple. Use a text box on the main form to hold the order id. I would use a sub form to display the desired record by setting the master/child link fields. No VBA required to display the records in the sub form.
IMHO, Forms are best for data entry. Why can't you use a sub form?
I agree. Access has a built in feature that relates the subform to the main form by one or more fields or controls. This would be an ideal application for what you are doing. The main form would be bound the the Orders table and the subform would be bound to the OrderDetails table and the link would be the ORderID field.
Then when you cycled through your orders the order details would appear below the order.