Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 1st, 2008, 11:49 AM
Registered User
Join Date: Apr 2008
Location: pearland, texas, USA.
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

Reply With Quote
  #2 (permalink)  
Old May 15th, 2008, 07:14 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
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

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
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 09:21 AM.

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