473,386 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Declare a varable for the entire database

31
I am trying to declare a maximum # of characters that can be inputted into multiple Memo fields. I have a len counter displaying the # of characters.

When the count gets to 10 lets say I want a msgbox to pop up. This is working. Instead of saying:
if lencounter >10 then
Msgbox "You have reached the maxium # of characters"
I would like to set the maximum # of characters once globally so my code would read.
if lencounter >MaxChar then
Msgbox "You have reached the maxium # of characters"
And I would declare the following:
Dim MaxChar as integer
MaxChar = 10
Nov 19 '08 #1
2 1240
RuralGuy
375 Expert 256MB
That is done in a standard module (not a form module) before any procedures. You could also use a constant. The Help system can assist you here.
Nov 19 '08 #2
ADezii
8,834 Expert 8TB
As indicated by RuralGuy, in a Standard Code Module:
Expand|Select|Wrap|Line Numbers
  1. Public Const conMAX_NUM_OF_CHARACTERS As Integer = 10
Nov 19 '08 #3

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

Similar topics

3
by: Ron_Adam | last post by:
Hi, Sometimes it just helps to see what's going on, so I've been trying to write a tool to examine what names are pointing to what objects in the current scope. This still has some glitches,...
2
by: Graham Mattingley | last post by:
How to I test a varable to see if it contains a number and not a text value ?? I want to use this to detect if people have edited my get strings in the URL field of the browser, before it gets...
2
by: FlashMerlot | last post by:
We have an ASPX (C#) webform which hosts dropdownlists, textboxes, grids, checkboxes, etc. The users want to: #1 - "FREEZE" the entire webpage contents (and state) #2 - move IE browser to...
8
by: Johm | last post by:
In my codes i am often referring to one and the same controls.Is it possible to declare these controls only once and then insert them in all my functions and subs? For example, i am often...
19
by: Andy B | last post by:
Hello, Sorry for this newbish question. Briefly, my problem: ------------------ I expect the database I'm working on to reach something in the order of 12-16 Gigabytes, and I am interested...
1
by: Gary | last post by:
Open the web browser at the same time, the session varable in the second broswer is disappeared. All The Session Varable is declared in the webform page load.
2
by: Suresh Kumar Rathod | last post by:
HI friends... Can any body give reason / logic behind static varable lifetime through out the process execution. i.e how does compiler maintains the static varable life through out the process...
3
by: BOBss | last post by:
I have an .ASP page that comes up, and I am trying retrieve a variable from the previous .ASP page. However none of the variables from the previous .ASP page are available to the current .ASP page....
0
by: forgedascendant | last post by:
Hello All, I am kinda new to VBA interacting with excel...or just VBA for that matter. I was wondering if there was a was to determine if a ranged varable (lets say ProductXRange) is empty? ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.