Advertisement

03.27.2008 at 05:12PM PDT, ID: 23276109
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Automatically display default value in text box on form
Zone: Access Forms
Tags: Microsoft, Access, 2003
Would anybody happen to know of a way that I can have a form automatically display the "Default Value" on some text boxes in a Form?

The default value works like a champ, but the values aren't displayed until part of the record is created.  I'd like to have the default value displayed as soon as the form is loaded, even if no other record data is present.

I know a quick workaround to this is to assign the default value in the table itself, versus inside the text box on the form, but that's not what I'm trying to accomplish here.

As always, everyone here is extremely helpful, and I'd like to thank you for your time assisting me.
Start your free trial to view this solution
Question Stats
Zone: Microsoft
Question Asked By: usslindstrom
Solution Provided By: jefftwilley
Participating Experts: 3
Solution Grade: A
Views: 226
Translate:
Loading Advertisement...
03.27.2008 at 05:26PM PDT, ID: 21227025

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 06:27PM PDT, ID: 21227321

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 06:48PM PDT, ID: 21227432

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 06:50PM PDT, ID: 21227438

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 07:04PM PDT, ID: 21227492

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 07:22PM PDT, ID: 21227568

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 07:27PM PDT, ID: 21227583

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 07:37PM PDT, ID: 21227621

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 07:40PM PDT, ID: 21227630

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 08:46PM PDT, ID: 21227879

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 08:51PM PDT, ID: 21227897

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.27.2008 at 05:26PM PDT, ID: 21227025

Rank: Wizard

You might consider assigning these values yourself, in the Form's Open event:

Sub Form_Open()
  Me.Textbox1 = "SomeValue"
  Me.Textbox2 = "SomeValue"
  '/perhaps try
  Me.Textbox3 = Me.Textbox3.DefaultValue
End Sub
 
03.27.2008 at 06:27PM PDT, ID: 21227321

Rank: Wizard

This is an interesting question. Default values do appear on a bound textbox when you go to New record. Otherwise, the value in the underlying field would appear. Are you trying to force a value where there may or may not already be one?

Scott has the right idea, but if this is a normal recordset where there is more than one record, then you'll get that value set each time the form opens for Record 1 only.

Am I missing something?
 
03.27.2008 at 06:48PM PDT, ID: 21227432
Yeah - sorry for being vague on my original explination.

I have a form that's filtering a query by now().  I know it's not really best practice to do that, but it ensures that my end users get the data time-stamped the moment they click on the item (it's a create work request form) to make one.

So, jefftwilley - you are 100% right on the money with me trying to force a value where there isn't one already.

LMSConsult - it seems you're always bailing me out of my access pit with some awesome ideas!  Thanks for always helping...  But I keep getting an error in the coding on those...  when I load it at the "on open" for the main form.  Not entirely sure I want to throw a subform on this original one though.
 
03.27.2008 at 06:50PM PDT, ID: 21227438
**Plus the idea behind the now() filter, that a record isn't created if a teacher accidentally just clicks on the button to make a work request**

A record is only created that way if they type stuff in some of the text fields.
 
03.27.2008 at 07:04PM PDT, ID: 21227492

Rank: Wizard

The plot deepens. And I'm sure you've thought this through, but filtering using Now() will never return any records. Ever.

if this is a "Add New Record" form, then why not just force it to go to a new record when the form opens. The default will appear, and when the record is committed, the value of Now() is saved.

is there a different process going on than that?

J
 
03.27.2008 at 07:22PM PDT, ID: 21227568
Actually - that would be a very doable solution.  :)

Is there a code I can add to the "on open" or something simlar that automatically creates a new record each time the form is opened?

The bad portion of this would be, what I was mentioning before.  I kinda' don't want a record created every time one of my end users mistakingly clicks on the "Submit Maintenance Request" button.
 
03.27.2008 at 07:27PM PDT, ID: 21227583
Yes on the "thinking it through" part as well.  :)

My end users were getting confused (they're elementary teachers) on some of the forms I was making, because it contained all the previous data they had entered (we're filtering by a username script to alot of our forms to display data only belonging to that particular user) - and to throw a quick solution between what the end users ses and what we admin people can see, that now() filter worked like a champ, and we've applied to to 99% of their forms accross the board.

Problem solved on our end.  :)  (The now() filter one)
 
03.27.2008 at 07:37PM PDT, ID: 21227621

Rank: Wizard

this one is fairly simple

    DoCmd.GoToRecord , , acNewRec

seems like there should be more to it doesn't it? :)

J
 
03.27.2008 at 07:40PM PDT, ID: 21227630

Rank: Wizard

just because you go to a new record, doesn't mean anything is saved unless the rercord becomes "dirty"

you can do a quick check when the user closes the form, or does something else where you think the record is going to be saved..

Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty = True Then
    If MsgBox("Would you like to discard changes?", vbYesNo) = vbNo Then
        Cancel = True
    Else
        Me.Undo
    End If
End If
End Sub

hope this helps out.
J
 
03.27.2008 at 08:46PM PDT, ID: 21227879
Please forgive my small understanding of coding...  But I'm having a little trouble implenting that line you gave me...

Here's what I got::  (It looks like it's working on load *no error msg* But it's still having a small issue with throwing the defaults in the text box until I type something on some of the other areas of the form to make a "dirty" record)
1:
2:
3:
Private Sub Form_Open(Cancel As Integer)
DoCmd.GoToRecord , , acNewRec
End Sub
Open in New Window
 
03.27.2008 at 08:51PM PDT, ID: 21227897

Rank: Wizard

If you put a default value in the properties of one of your textboxes on the form, and manually navigate to the new record using the navigation arrows at the bottom of the form, do your defaults not show up there?

I'm putting the acnewrecord code in the on_load event and opening my form. It goes right to the new record and it pops the defaults right in.
Accepted Solution
 
 
03.27.2008 at 09:52PM PDT, ID: 21228115
Normally, it goes like this:

If the form has Fetch Defaults: Yes, all default values are displayed in the "new" record, before editing. If the option is No, then only the default values defined directly in the form's controls are displayed, but those from the table are not "fetched".

Try various combinations of table-level default values, form-level default values, and the setting "fetch defaults". I'm sure you can find something that works.

Incidentally, you can change the control's default value through code.

(°v°)
 
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628