Re: Microsoft Office updates that are not backward compatable with Microsoft VB 6.5

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Oct 9, 9:49 am, "Norman Yuan" <FakeN...@xxxxxxxxxxxxx> wrote:
Also, in VB/A

Dim rst, rstFill As ADODB.Recordset

is different from

Dim rst As ADODB.Recordset
Dim rstFill As ADODB.Recordset

For the former,

rst is declared as Variant, since no type is specified with "As" keyword.
That is, in VB, any variable declared without "As" will be Variant, whether
it is declared in the same line of code, seperated with "," or not. For
better readability and for the explicity, I never declare variable in one
line of code in VB.

<kim.for...@xxxxxxxxxxxxxxxxxxxxx> wrote in message

news:df3f7d4b-540d-4866-a65e-cadd5f3a7c41@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



Hi,

I am a VB and VBA novice who inherited an Access Database with VB code
that suddenly doesn't work on any machine or for any backup.  I've
looked at the code and to my novice eyes it seems OK. I was wondering
if there was any VB or VBA change that would make this code suddenly
break.  The first error I get is:
"Duplicate Declaration for current scope"

There are the duplications:
Private Sub txtSearchVal_Change()
   Dim rst, rstFill As ADODB.Recordset
   Dim sqlQuery, fillQuery As String
   Dim ChurchID, envYear As Integer
   Dim ChurchID As Integer
   Dim identifier As Variant
   Dim msgOK, intPosition As Integer
   Dim LastName, firstName As String
   Dim idType As Integer

I see that ChurchID is a duplicate declaration; but everything worked
fine until about a month and 1/2 ago, any ideas why it suddenly isn't
working?

Thanks- Hide quoted text -

- Show quoted text -

Thanks for the replys.
I made the changes and got an "invalid method" error. I replaced the
me.field references with me!references and everything works find now.

Thanks again!
Kim
.



Relevant Pages

  • Re: An alternative to possreps
    ... declare Circle as another dummy type. ...     type Ellipse; ...
    (comp.databases.theory)
  • Re: "Sorting" assignment
    ... If the array is already sorted, this means that you end up ... less time than a bubble sort, ...     int intLeft, ... I don't declare anything inside of a loop is why. ...
    (comp.programming)
  • Re: Code style question
    ... It does matter a whole lot more with environment access as DEFTYPE ...     definitions can access the current compilation environment. ... (declare (notinline foo) ...
    (comp.lang.lisp)
  • Re: THE to function as DECLARE?
    ...     ... the THE form is redundant in (THE FIXNUM 2). ... AMX> (declaim (inline square)) ... time even when I don't feel like adding (declare ..)'s "manually". ...
    (comp.lang.lisp)
  • difference between declare with new and set keyword?
    ... (declare that you want to use it), ... Dim rst As ADODB.Recordset ... now you have to initialize it. ... object is reflected in all variables that refer to it. ...
    (microsoft.public.access.modulesdaovba)