473,322 Members | 1,540 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,322 software developers and data experts.

Can some give me reason for this

syedshaffee
Hey people,

I have a line of code which is Wrong I want to Known the reason Why it is so
Expand|Select|Wrap|Line Numbers
  1. private dim a as integer
  2.  
  3.  
I Known we can use only one of this for defining a variable.

What is the reason for that why can't we use both in vb

Please help on this guys......?
Sep 13 '12 #1

✓ answered by zmbd

You need to provide more context.
If this line is in the declarations section of the module then the DIM is implied, remove it.
Private will restrict the scope of the variable to the calling module.

As for why one is allowed or not allowed in VBA vs VB... that is an impossible to answer question in that you'd have to understand the minds of the developers.

-z

-z

3 1316
zmbd
5,501 Expert Mod 4TB
You need to provide more context.
If this line is in the declarations section of the module then the DIM is implied, remove it.
Private will restrict the scope of the variable to the calling module.

As for why one is allowed or not allowed in VBA vs VB... that is an impossible to answer question in that you'd have to understand the minds of the developers.

-z

-z
Sep 13 '12 #2
Thank u For a your reply
Sep 13 '12 #3
Yup... you got to choose
Expand|Select|Wrap|Line Numbers
  1. dim a as integer
in procedure declaration level
or
Expand|Select|Wrap|Line Numbers
  1. private a as integer
in module level declaration level if you would like to use this within all procedures in the module where it is declared.
Sep 13 '12 #4

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

Similar topics

7
by: Jonathan Fine | last post by:
Giudo has suggested adding optional static typing to Python. (I hope suggested is the correct word.) http://www.artima.com/weblogs/viewpost.jsp?thread=85551 An example of the syntax he proposes...
38
by: jrlen balane | last post by:
basically what the code does is transmit data to a hardware and then receive data that the hardware will transmit. import serial import string import time from struct import * ser =...
29
by: Mercury Mercurius | last post by:
Please help - I'm at my wits' end.... I'm getting two different placements of some content wrapped in a <span> tag in Netscape and Internet Explorer (big surprise!). I prefer how the page looks in...
5
by: LRW | last post by:
(Sorry if this is a repost...my newsreader keeps crashing on the posting--I don't know if the message going out or not) For some reason this javascript just won't work in Firefox. It works fine...
4
by: Daniel Jin | last post by:
look at the sampl <pre using System class Bas public virtual void Print(
1
by: GERM | last post by:
Hi, Is it in dotNet possible to give a starting Thread a value on startup?? Thread* connecttoserver = new Thread(new ThreadStart(0, ConnectToServer)); connecttoserver->Start(); ...
1
by: Ian Semmel | last post by:
In form designer view, if you cut a control and then paste it into eg a panel, all the Event functions are cleared from the properties view.
2
by: Sebastian | last post by:
Hi I have a little problem I sending email in Html using mail() function and everything is ok but when i open email in outlook i have following information: This might be a phishing message...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.