Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 1st, 2008, 11:49 AM
Registered User
 
Join Date: Apr 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to captainlove
Default A Revised field on a form

I have a datasheetform that takes it value off a query. In my datasheet form there is textbox that has a value (unit cost),that it take off the query that feed the form.

Then I have an unbound textbox(Revised cost) whose control source is unit cost. So I have two textboxes with the same value. What I want to do however is that everytime I enter a value into the revised textbox. I want this value to show up and to be stored as the value for that textbox until such a time when I decide to change this value again for a specific item.

Can anybody please help on how to make this happen

lucasfatoye
 
Old May 15th, 2008, 07:14 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Welcome to Wrox!

You wrote, "Then I have an unbound textbox (Revised cost) whose control source is unit cost." That is contradictory. If you have an unbound textbox, then it's unbound. You cannot have a control source as unit cost because that would make it a BOUND textbox.

Remove the control source for that and make it truly unbound. Then in its After Update event, set the .DefaultValue property to the value you just entered. Then when you have a new record, it's default value will always be the last thing you typed into it.

Me.RevisedCost.DefaultValue = CStr(Me.RevisedCost)

For some reason, the .DefaultValue property always wants strings as arguments. Don't ask me why Microsoft did that. If you use it to do math, you'll just have to change it back to currency using CCur(Me.RevisedCost).


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
Payroll in Access (Revised Posting) bright_mulenga Access 2 October 5th, 2006 10:17 AM
Any Revised/Corrected code available now..? SoftMind BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 July 21st, 2006 03:46 PM
Revised Thumbnail doubt. Please HELP!! cutesneakers PHP How-To 0 January 15th, 2005 06:57 AM
Beginning Visual C# revised edition alexjnz Wrox Book Feedback 9 November 2nd, 2004 01:35 PM
Working / revised set up instructions ? HSCIII BOOK: ASP.NET Website Programming Problem-Design-Solution 0 January 31st, 2004 11:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.