Jump to content
  • 0

How To Copy A Lookfield Value Into Another Tabel


BartVervenne

Question

Maybe the description of the problem is not what it should be but let me describe my problem.

 

I want to add products to an order.

I have an order table with  customer_ID, product_ID , Quantity, Unit_Price fields

I also have a product table with Product_ID, Product_Description, Unit_Price , and Stock_Quantity

 

When I enter a Product_ID (combobox) in my order tabel I want to copy the Unit_Price from the product table into the Unit_Price field in the order table.

 

What is the best way to do this ?

 

Thanx

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hello BartVervenne,

 

I think, you can use a Cascading Dropdown or another cascading element.

You can select Product_ID as the Parent field, then select the product table, select Product_ID in Filter cascade by, and select Unit_Price in Field for display and Field for value.

 

When you enter a Product_ID, Unit_Price will be displayed in the element, if the Product_ID is present in the table.

Link to comment
Share on other sites

  • 0

Thanks for the answer Caspio Guru, but this is no what I mean.

 

The price should really be stored in the Unit Price Field in the Orders Table because when I look at old orders I want to see the price of the moment of ordering and not the actual price.

So I am really looking at a way to copy the price of a product into the order table at the moment of entry of the order

Link to comment
Share on other sites

  • 0

Yes, the value of the Unit Price field of the product_table will be saved in the Unit Price field of the order_table.

 

I will try to write the steps:

  1. Create a Submission Form, select order table as the DataSource.
  2. Add product_ID field as you want.
  3. Add the Unit_Price field, select Cascading Dropdown Form element.
  • a) Select product_ID in the Parent Field dropdown box.
  • B) Select Lookup table or view in the Source dropdown box.
  • c) Select product_table in the Table or View dropdown box.
  • d) Select Product_ID in the Filter Cascade by dropdown box.
  • e) Select Unit_Price in both Filter for display and Filter for value dropdown boxes.

 

Now, when a user enters ID, the Unit price from the product table is displayed, and when the user clicks Submit, this value is stored to the order table.

 

Please correct me if my understanding is not correct.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...