473,614 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Created default value on form field, not showing

1 New Member
To simplify I have an Inventory table: ItemCode is prime key with a SalesPrice field.
I have a WSales table with ID as prime key and ItemCode (duplicates allowed), SalesPrice field and SalesQty field.
On the capture form I want to capture the SalesQty and the SalesPrice for an ItemCode. This SalesPrice is usually the same as the SalesPrice field in the Inventory table but it could vary. So to save capture time i would like the SalesPrice from Inventory to show on the form as the default value.
I have created a default value for SalesPrice on the form as
=[Inventory]![SalesPrice]
Does not work as the form field remains empty
The two tables are linked by ItemCode in a one to many relationship
Any suggestions would be most welcome.
By the way, new to Access so not yet up to speed on VBA or SQL
Using Access in Office365
Feb 12 '19 #1
1 1407
twinnyfo
3,653 Recognized Expert Moderator Specialist
BusterS,

Welcome to Bytes!

Instead of =[Inventory].[SalesPrice] you would want simply =[SalesPrice] as the Control Source of that text box. This should allow you to update the actual sale price to a discounted value if you so desire.

If that does not work, your best bet is to use the OnCurrent event of your form, and update that field in VBA:
Expand|Select|Wrap|Line Numbers
  1. Me.txtActualPrice = Me.SalePrice
Hope that hepps.
Feb 12 '19 #2

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

Similar topics

3
2767
by: TekWiz | last post by:
I've got a system that automatically generates a form. I have it set up so that the backend will return to the inital form page with an error object in sessions data (assuming the backend detected invalid data or required fields not filled in) and the frontend will generate an initial value of items WITHOUT errors (so the user doesn't have to reenter valid info). This is the problem. The frontend generates the initial value attribute...
2
1266
by: Lex Luthor | last post by:
with "select @@IDENTITY" i get the value of the last field insered.. i would like to get also the field.name help me plaese
11
12470
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this with a query but don't know what the criteria needs to be. Any help would be appreciated, Thanks
1
2510
by: tnriverfish | last post by:
I've got a text box on a form where the default value shows - C:/ The user can change the default to whatever they want - D:/ I'd like to put a button next to the field that will change the default from C:/ to D:/ so the next time the form is opened D:/ is showing. Any ideas? Thanks Charlie
2
11216
by: tezza98 | last post by:
Help please, Im using SQL server Management Studio Express and i want to change the default value of a varchar(50) column. i want the defaultdate to be like this '5/04/2007 11:15 pm System generated' So i have tried to do this: (getDate())+'System generated' (getdate()).'System generated' but neither seem to work
5
2190
by: vandanavai | last post by:
Hello, I have problem in setting default value of field. What I want to do is as follows. I have 'Table' with fields 'PurchaseDate' and 'CapitalisationDate'. I want to set dafault value of field 'CapitalisationDate' as date entered in field 'PurchaseDate". But user will have option to change it. That means unless user changes value in field 'CapitalisationDate' , it will be same as date in field 'PurchaseDate'. How to do this? Please help...
4
2034
by: rczuba | last post by:
Problem: Creating a Default Value for a field in a subform when a field in the subform & form match. I'm trying to create a payroll database for a small home business that I have that has had (and hopefully will continue to have) lots of growth. I have created a Transaction table to hold the hours, date, location of work (as the employees work at various locations), pay rate, and employee id. the employee id field has a one-to-many...
1
1207
by: lonjovy | last post by:
So,please help me to split value from table like below field A has value below 13974;14098;14237;14269;14317;14319;14392;14393;13257;13983;13820 and i need to split and down value in row like below file B 13974 14098 14237
6
3014
by: Mihail | last post by:
Hello ! I have a form, (in a FE database) bound to a table (in a BE). You understand that is, in fact, a linked table, because I am in FE. In this form I have some labels (for bounded controls) with the TipText "Double click me to set THIS value as default for this field". For now, I have another table "NewDefaults" where I store records for this (new) default values, with this structure: Table, Field, NewDefaultValue and an Index,...
0
8124
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8272
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8427
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5538
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4049
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4119
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1712
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1421
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.