Trouble with variables

  • Thread starter Thread starter Meilu
  • Start date Start date
M

Meilu

I am suffering from a VERY IDIOTIC problem...

I am coding in VB, I declare a variable ... either
global or in a parameter ... and it is not recognize when
I compile!
Example 1:
Option Compare Database
Option Explicit
Private cInfo As String
Private comInfo As String

Public Property Get ContactInfo() As String
ContactInfo = cInfo
End Property

Problem: cInfo NOT declared!

Exampled 2:
Public Sub PullContactInfo(eType As String, eName As
String, openForm As Boolean, Optional cName As Variant)
Dim stDocName As String
Dim stLinkCriteria As String
Dim EntityType As String
Dim EntityName As String

EntityType = eType
EntityName = eName

stDocName = "Contact Information"
'Debug.Print eType
'Debug.Print eName
stLinkCriteria = "[EntityType]=" & "'" & eType
& "'" _
& "AND [EntityName]=" & "'" &
eName & "'"

......

Problem: stLinkCriteria not defined/declared. OR
eType/eName not declared.

I really don't want to have to restart ... cause this is
A LOT OF WORK... but at the same time ... I can't imagine
any other solution!

Any idea on why this is happening?

Meilu
..
 
Meilu said:
I am suffering from a VERY IDIOTIC problem...

I am coding in VB, I declare a variable ... either
global or in a parameter ... and it is not recognize when
I compile!
Example 1:
Option Compare Database
Option Explicit
Private cInfo As String
Private comInfo As String

Public Property Get ContactInfo() As String
ContactInfo = cInfo
End Property

Problem: cInfo NOT declared!

Exampled 2:
Public Sub PullContactInfo(eType As String, eName As
String, openForm As Boolean, Optional cName As Variant)
Dim stDocName As String
Dim stLinkCriteria As String
Dim EntityType As String
Dim EntityName As String

EntityType = eType
EntityName = eName

stDocName = "Contact Information"
'Debug.Print eType
'Debug.Print eName
stLinkCriteria = "[EntityType]=" & "'" & eType
& "'" _
& "AND [EntityName]=" & "'" &
eName & "'"

.....

Problem: stLinkCriteria not defined/declared. OR
eType/eName not declared.

I really don't want to have to restart ... cause this is
A LOT OF WORK... but at the same time ... I can't imagine
any other solution!

Any idea on why this is happening?

Nope, none. If you'd like to send me a cut-down copy of your database,
containing only the elements necessary to demonstrate the problem,
compacted and then zipped to less than 1MB in size (preferably much
smaller) -- I'll have a look at it, time permitting. You can send it
to the address derived by removing NO SPAM from the reply address of
this message.
 
Dear Dirk,

Thanks for the offer. I think I'll take it ^_^
But ... the problem has expanded to the point where
Queries no longer work either! Even when I copy
everything into a new project nothing seems to help!!!
And I KNOW that my simple Queries SHOULD BE WORKING!

Any idea why my Access is flaking on me so badly?

-Meilu
 
Meilu said:
Thanks for the offer. I think I'll take it ^_^
But ... the problem has expanded to the point where
Queries no longer work either! Even when I copy
everything into a new project nothing seems to help!!!
And I KNOW that my simple Queries SHOULD BE WORKING!

Any idea why my Access is flaking on me so badly?

It begins to seem likely that your database is corrupt. However, I
can't confirm that until I've had a look at it. Are the queries that
are failing using any VBA or user-defined functions?
 
Hi Dirk,

Thanks again for the offer. But I just re-started from
scratch. (The problems were so widespread ... I wasn't
sure how to give you a project to illustrate the
problems :-p )

I think the project was corrupted ... but I don't know
how to fix a corrupted project. I tried "compacting"
it ... but that didn't seem to help much.

If you could give me some advice on how to PREVENT
corrupted databases or how to fix it... that'd be great!

Happy Holidays,
Meilu
 
Back
Top