Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > Courses > Access > Developer > D33 > < D32 | D34 >
Back to Access Developer 33    Comments List
Const in Default Value Upload Images   Link   Email  
Eduardo Benaim       
13 months ago
If I have A Global Const MyServer = "10.0.0.10"  

How do I put it in the "Default value" for a Field in a Form?

Apparently you can not put a Global Constant or Variable there.

Remember you making comments about it and had a solution. cant remember
Kevin Robertson             
13 months ago
Add an unbound text box to your form (as an example, I'm naming it txtServer) then add this to the On Load event of the form.

txtServer = MyServer

Since Constants cannot be changed I would also lock the text box.
Eduardo Benaim       
13 months ago
Yes but txtServer =  MyServer  & "\Docs\Document"   Does not work
Kevin Robertson             
13 months ago
What doesn't work?
Are you getting an error?

'Does not work' doesn't tell us anything.
Richard Rost             
13 months ago
Is this in a public module or a form module?
Richard Rost             
13 months ago
Nevermind... I just re-read your question. What you're trying to do won't work. You can't use a VBA variable or constant in the default value property of a field. You can do it in code, but not directly. I'd recommend using a TempVars value. This would actually make a good tip video. Give me an hour.
Richard Rost             
13 months ago
Here you go: Variable Default
Eduardo Benaim       
13 months ago
This video is Great. I love the TempVars solution. Thank you very much.
Scott Axton            
13 months ago
Richard maybe a TempVars video has come to it's time?
Advocating on behalf of Adam (as well as myself and others)
Kevin Robertson             
13 months ago
Yeah, I'm using TempVars a lot in my current database for user logons. Before it was always a Public variable in a module which is how I started this database until any errors generated cleared the variables and I had to go through the login process each time. Not a problem now I've switched to TempVars.
Eduardo Benaim       
13 months ago
Yes.  I second (or third) the motion for the video about TempVars.  Great Work!!!
Adam Schwanz              
13 months ago
Did somebody say TempVars?
Eduardo Benaim       
13 months ago
I can't hear you... Please say it Louder...
Richard Rost             
13 months ago
I'm throwing a little TempVars action in the Calculator video coming up...

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 33.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/25/2024 9:34:03 AM. PLT: 1s