473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Default Value

7
This may be very simple but I cant figure it out and it driving me nuts.

I have a form with a datasheet as a subform within it. Its is a Quote/Sale form.

I have a QuoteItems table and a Products table which I get the data for the QuoteItems subform.

I want the sell price from the Products table to populate into the actual sell price field in the QuoteItems table when I sellect the product. They are both fields in my QuoteItems subform.

I have tried to enter Forms!Quote!QuoteItems!SellPrice in the Default Value of the ActualSell but it doesn't work. I worked it out with an update query (triggerd by exiting the Item field) but if the listed sell price (in Product table) is changed and you revisit the quote it changes the ActualSell.

Any help / advice would be greatly appreciated.
Oct 4 '07 #1
3 1511
NeoPa
32,556 Expert Mod 16PB
I find your explanation a little hard to follow, but this (Referring to Items on a Sub-Form) link may help.
If not, come back and explain where you're stuck.
Oct 4 '07 #2
jaxjagfan
254 Expert 100+
This may be very simple but I cant figure it out and it driving me nuts.

I have a form with a datasheet as a subform within it. Its is a Quote/Sale form.

I have a QuoteItems table and a Products table which I get the data for the QuoteItems subform.

I want the sell price from the Products table to populate into the actual sell price field in the QuoteItems table when I sellect the product. They are both fields in my QuoteItems subform.

I have tried to enter Forms!Quote!QuoteItems!SellPrice in the Default Value of the ActualSell but it doesn't work. I worked it out with an update query (triggerd by exiting the Item field) but if the listed sell price (in Product table) is changed and you revisit the quote it changes the ActualSell.

Any help / advice would be greatly appreciated.
If you are using a combobox to give yourself or sales people a list to pick from:

Make sure the datasource for the combobox contains all the desired columns (you can set column widths to 0 if you dont want the coulmns to show in the drop list).

On the AfterUpdate property of the combobox (cboProdList):
Expand|Select|Wrap|Line Numbers
  1. me.txtprodID = cboProdList.Column(1)
  2. me.txtproduct = cboProdList.Column(2)
  3. me.txtprice =  cboProdList.Column(3)
Me = your pick list form. and txtprodID, txtproduct, and txtprice would be the textboxes where you want the values stored. This would populate the quote form with the "current" product info without being affected by future product changes.
Dec 19 '07 #3
NeoPa
32,556 Expert Mod 16PB
Another similar question can be found at Setting Default Value.
Dec 20 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

29
by: John Wood | last post by:
Even though CSC does its best to detect use of unassigned variables, it often misses it... for example if you just declare a double in a class without assigning a default value, it has a default...
74
by: Zytan | last post by:
I have a struct constructor to initialize all of my private (or public readonly) fields. There still exists the default constructor that sets them all to zero. Is there a way to remove the...
23
by: Jess | last post by:
Hello, I understand the default-initialization happens if we don't initialize an object explicitly. I think for an object of a class type, the value is determined by the constructor, and for...
4
by: Jess | last post by:
Hello, I tried several books to find out the details of object initialization. Unfortunately, I'm still confused by two specific concepts, namely default-initialization and...
10
by: Brad Baker | last post by:
I have an asp.net/csharp application that requires a particular variable to work properly. This variable is usually passed via a query string in the URL when the application is first run but under...
4
by: Macneed | last post by:
i am a newbie, i remember i read a book talking about when u declare a array variable using float ABC = new float; the whole array element in ABC ( ABC to ABC ) will automatic initialize to 0...
4
by: Dave Burns | last post by:
Hello, I am trying to specify a logical default value for a in a WCF Web Service using basicHttpBinding. I realize that the language defaults are: int - 0 string - null bool - false
7
by: =?Utf-8?B?Y291Z2FyaXN0aWM=?= | last post by:
I am trying to convert an C# application to VB and have one issue which is converting the generic value to the default. C# uses return default(T) as the return value how would I translate this in...
43
by: kenneth | last post by:
Dear all, I have encountered this weird problem. I have a class definition with an __init__ argument 'd' which defaults to {}. This argument is put in the 'self.d' attribute at initialization...
9
by: lawpoop | last post by:
I'm trying to write some simple code, but I might be simplifying it too much. I have a function that either returns a string that I want, or FALSE. In the code that I'm working on, I would like...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.