By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,855 Members | 1,970 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,855 IT Pros & Developers. It's quick & easy.

Created default value on form field, not showing

P: 1
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
Share this Question
Share on Google+
1 Reply


twinnyfo
Expert Mod 2.5K+
P: 3,158
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

Post your reply

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