Variant Data Type Acc97 and 2000

Len Boorman

Back in gainfull employme
Local time
Today, 08:35
Joined
Mar 23, 2000
Messages
1,930
This is a follow up to a problem I had with a Subreport which I have now solved but would like additional information on the differences between 97 and 2000.

basically I ghad a subreport that worked in97 but gave Invalid Argument in 2000.

It appears that the linking field was too long and this caused the Invalid Argument.

The fileds were a concatonation of two fields. One Number and One Text Field. Yes they were a bit long in certain circumstances but for fairly good reasons. I believe these would be generated as Type Variant.

Does anybody know the differences in teh Variant Type between 97 and 2000. I have tried searching teh Help in 2000 but unable to find any info or indeed the correct phrase to search on.

len
 
I'm not an expert on this but :
Use the Option Explicit statement that appears in the beginning of your code modules to ensure that all variables are explicitly declared in your procedures.
In Access 97, new modules contain the Option Explicit statement by default. However, this isn't the case in Access 2000. Although you can manually type the statement into your modules, changing a setting in Access can ensure that the statement is always added to new modules.

Would this help ?
 
Thanks rak I will have a look. Actually solved problem by reducing the offending text string prior to concatonation. It does appear that variants are "different" between 97 and 2000

Len
 
Len,
Did another search which gave me :

If you want to declare multiple variables in one line of code, be sure to specify the type for each variable, even if the variables are the same type. For instance, avoid code like the following:

Dim strFirstName, strLastName, strTitle As String

In such a case, only the last variable, strTitle, is actually declared as a String type. The first two variables are created as Variant data types. To correctly declare the three variables, you would use the statement

Dim strFirstName As String, strLastName As String, strTitle As String

This seems to be the same for 97 as for Access 2000.
 

Users who are viewing this thread

Back
Top Bottom