By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,488 Members | 2,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,488 IT Pros & Developers. It's quick & easy.

Declare a varable for the entire database

P: 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
Share this Question
Share on Google+
2 Replies


RuralGuy
Expert 100+
P: 375
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
Expert 5K+
P: 8,597
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

Post your reply

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