Hi John,
The order for is not a subform for customer form. Customer form is
displaying one particular customer, but if the customer wish to create an
order , he click on a button in the customer form and the order form is
showing. I already add the combo box in form order and I assign itsβ default
value to be the customer ID where is taken form the customer form, but the
order can not be created unless I choose the ID from the Combo box. What I
want to do is add the customer ID in combo box with no action from the
customer. The customer is only be able to select the products from the
subform only. I am trying to simulate an online shop
"John W. Vinson" wrote:
> On Fri, 25 Dec 2009 12:27:01 -0800, Jon <(E-Mail Removed)> wrote:
>
> >Hi,
> >I have a form a form to show the customer information and I button to create
> >new order for him. The Order form has the following fields:
> >OrderID>>>autonumber
> >cutomerID
> >employeeID
> >β¦.
> >Also, there is a subform that is bounded on the Order Details table which
> >has the following fields:
> >OrderID
> >ProductID
> >β¦..
> >
> >What I want to do is once the Order form open, I want access to set the
> >CustomerID value based on the customerID that is on customer form and
> >generate a new OrderID in order to pick the Product ID from the subform. I
> >try to set the value for the customer ID field in main form to be dufalted
> >using the following expression:
> >=[Forms]![Customer Details/Orders]![CustomerID]
> >
> >The value is successfully added but when I tried to pick up a product from
> >the subform , an error message appears as follows:
> >β You tried to assign the null value to a variable that is not a variant
> >data type.β
> >
> >Finally, what I want to do is assign & create a new order without entering
> >customer ID into the order form. Any suggestion please?
>
> If the order form were a Subform of the customer form, using the CustomerID as
> the master/child link field, this would be automatic and would require no code
> at all.
>
> If, however, you get even a little bit of return business, you should consider
> just having a Combo Box on the Order form to select (rather than typing in)
> the customer ID, displaying the customer name and other identifying
> information for the user to select the right customer. You can use the "Not In
> List" event of this combo to pop up a customer entry form when it's a new
> customer.
> --
>
> John W. Vinson [MVP]
> .
>
|