Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting a val from field

Status
Not open for further replies.

chaosguy

Programmer
Joined
Nov 5, 2005
Messages
45
Location
VC
Ok this is the delemma i'm having. I have this form that stores customer details and a cmd button that opens a new form to add the order details for the customer. There is a customer table and a order table, and a customer_order table with the customer ID and Order Id. I want the order form to fill in some fields automatically. These fields will be stored in the customer_order table to help and link customers to their orders. So on the order form, there will be an Order ID and cUSTOMER id, that will not be visable but present that I want to automatically fill in from the customer Id, on the customer form and and the order Id on the order form. So when I save the info, the customer_order table will be able to link the two. The Customer ID will come from he Customer form (customer ID) that i am on.

How do i transfer that value from the customer form, to the order form customer id coloum that will be stored in the customer_order.

I hope you under stand what I am getting at, cause it might be abit confusing. Hope you guys can help, bye.

Chaosguy - To die would be an awefully big adventure.
 
so, you have a customer form and an order form, correct? do you open your order form while the customer form is still open? if you do, and if you have a control that has customer id on the order form, you can set the default value of that control as the customer id value from the customer form.
 
yeah the customer form is still open while the order form is open. The order form will be untop the customer form. And yea that would work. Do you have a code to do that?

Chaosguy - To die would be an awefully big adventure.
 
should just need:
[Forms]![Customer Form Name]![Control Name]
in the default value on the properties for the customer id control.
you only need the [] if there are spaces in your names
 
yeah that wordked in getting the value in, but how do i get it to save in the cutomer_order form? I got the value but it doesn't put the value in the table i wnat it to oviously. How do I do this?

Sorry if this is a stupid question. I got the rest values for the rest of the form to save cause i used the wizard.

Chaosguy - To die would be an awefully big adventure.
 
ah, you are talking about getting the id into the linking table, not a table that is bound to a form. the only thing that i could think of to do that would be to open that table as a recordset in code and add in the 2 values. but hopefully someone else is watching and knows of an easier way.
 
well i sure hope so, but thanks anyways. I was trying to evade doing that cause well I'm not quite sure how to do it :S. But you know what they say, ya can't run away from something on a circular path. If there is anyone who knows of an easier way r can help me make this code, please help. thank u.

Chaosguy - To die would be an awefully big adventure.
 
i don't know how well this would work, but i was thinking maybe you could base the order form on a query that includes everything from orders table and the customer_order table. the fields from customer_order can be made not visible, and then you can use default value tricks to get the value into the table. that may do the trick, though maybe not the most elegant solution.
 
Hum, I think i'd do it with the code. I'm sure I'd figure it out sooner or later. thanks anyways spizotfl

Chaosguy - To die would be an awefully big adventure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top