If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Declaring variables - basic question
I have found a number of instances in the database I have inherited where
variables have been declared "Dim rs, rh, Dt As Recordset". Does this mean that rs, rh and Dt are all declared as recordsets or has the previous programmer misunderstood and rs, rh are actually variants and dt is a recordset? Thanks in advance |
#2
|
|||
|
|||
Declaring variables - basic question
The latter.
In some languages, including VB.NET, you can declare multiple variables in this way, specifying the type only once at the end of the line, but in 'classic' VB and VBA you need to specify the type of each variable, or, as you say, Variant will be used by default. -- Brendan Reynolds Access MVP "Will" wrote in message ... I have found a number of instances in the database I have inherited where variables have been declared "Dim rs, rh, Dt As Recordset". Does this mean that rs, rh and Dt are all declared as recordsets or has the previous programmer misunderstood and rs, rh are actually variants and dt is a recordset? Thanks in advance |
#3
|
|||
|
|||
Declaring variables - basic question
"Brendan Reynolds" wrote in message ... The latter. In some languages, including VB.NET, you can declare multiple variables in this way, specifying the type only once at the end of the line, but in 'classic' VB and VBA you need to specify the type of each variable, or, as you say, Variant will be used by default. -- Brendan Reynolds Access MVP "Will" wrote in message ... I have found a number of instances in the database I have inherited where variables have been declared "Dim rs, rh, Dt As Recordset". Does this mean that rs, rh and Dt are all declared as recordsets or has the previous programmer misunderstood and rs, rh are actually variants and dt is a recordset? Thanks in advance To the OP: And if you are going to correct this mistake, you may as well specify the object library while you're at it. In other words, change: Dim rs As Recordset to either Dim rs As DAO.Recordset or Dim rs As ADODB.Recordset depending on which was intended. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Basic Question for Lookups. | Bernard Piette | Database Design | 9 | December 19th, 2005 12:32 AM |
Basic INDEX(MATCH()) Question: | Adam Kroger | General Discussion | 6 | December 17th, 2005 04:30 AM |
Very basic IF question | Veli Izzet | General Discussion | 2 | December 16th, 2005 07:52 PM |
Very basic "How To Save a Database" question. ***Accesss 2002 | Lou | New Users | 2 | January 29th, 2005 12:26 AM |
basic question!!! | sylvain | Worksheet Functions | 5 | October 9th, 2003 06:19 AM |