Open a new order from the customers form

buratti

Registered User.
Local time
Today, 17:58
Joined
Jul 8, 2009
Messages
234
I asked a similar question a little while ago, and some answers made me decide to basically just start over with a different design/structure. I have a customers form, and an Orders form, with Order Detail subform. I am trying to put a button in my Customers form that when clicked, it opens the Orders form for that customer, but the Order Details subform is blank, or in Add mode. Right now I can get it to open to the current customer, but it's to the record of the first of any previous orders. How can I get it to a new order?

Currently the onclick event is an embed macro where:
Action is OpenForm
Form Name is Orders
Condition is ="[Customer ID]=" & [ID]

I can also get it to open the whole form in add mode, and then just select the customer from the dropdown list, but I'm trying to eliminate that step.
Any suggestions???
Thanks
 
Are you wanting it to work so that when you create the new order the customer ID is already filled in?

If yes, then you will have to pass the Customer ID in some what. This is not the same as the "Condition Is". AFAIK, the "Condition Is" only works for filtering existing records.

Using the On Current event of the "Orders" form, you can:

1) "push" the ID as an OpenArgs value
or

2) "pull" the value form the customer form.


I have not used macros since Access 2.0, so I am not sure how to handle this with a macro.
 
Are you wanting it to work so that when you create the new order the customer ID is already filled in?
Yes that is exactly what i am looking for!!! Customer ID, as well as Name and Address fields

Using the On Current event of the "Orders" form, you can:

1) "push" the ID as an OpenArgs value
or

2) "pull" the value form the customer form.

Sorry for my ignorance, but how??? I dont mind doing whatever needs to be done in VBA, but I am still in the begining steps of learning it and have no clue on how to "push" or "pull" values. Any chance you can supply general code, or point me in the right direction as to how to start and I can modify it to work in my database?
 

Users who are viewing this thread

Back
Top Bottom