InSrRev( ) problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alain.

    #1

    InSrRev( ) problem

    Dear all,

    Acess 2000. Here is may problem : i want to extract the path of
    my DB without thr name of the DB file, something like
    D:\MyFolder\ I use this code but the Instrrev line is not
    accepted : error (5) and (I try to translate) : incorect argument
    or or procedure call. What is wrong ? (References ?)

    Private Sub Form_Open(Cance l As Integer)
    Dim Bigpath As String
    Dim SmallPath As String
    Dim Slashloc As Integer

    Bigpath = CurrentProject. FullName ' ok
    Slashloc = InStrRev(Chemin Complet, "\", Len(Bigpath)) ' this line
    failed (?), Len(bigpath) works
    Path = Left(CheminComp let, Slashloc)
    End Sub

    Thank you
    Alan--
    _______________ _______________ ___

    Site photo personnel :




  • Bruce Rusk

    #2
    Re: InSrRev( ) problem

    I've had similar problems with string functions (specifically, strconv()),
    and found that they had to do with the comparison type. You should check out
    the optional compare argument in the InStrRev() function and look at this
    posting on a problem with the defaults:




    HTH,

    Bruce Rusk

    "Alain." <_@wanadoo.fr > wrote in message
    news:bk7dme$ref $1@news-reader1.wanadoo .fr...[color=blue]
    > Dear all,
    >
    > Acess 2000. Here is may problem : i want to extract the path of
    > my DB without thr name of the DB file, something like
    > D:\MyFolder\ I use this code but the Instrrev line is not
    > accepted : error (5) and (I try to translate) : incorect argument
    > or or procedure call. What is wrong ? (References ?)
    >
    > Private Sub Form_Open(Cance l As Integer)
    > Dim Bigpath As String
    > Dim SmallPath As String
    > Dim Slashloc As Integer
    >
    > Bigpath = CurrentProject. FullName ' ok
    > Slashloc = InStrRev(Chemin Complet, "\", Len(Bigpath)) ' this line
    > failed (?), Len(bigpath) works
    > Path = Left(CheminComp let, Slashloc)
    > End Sub
    >
    > Thank you
    > Alan--
    > _______________ _______________ ___
    >
    > Site photo personnel :
    >
    > http://perso.wanadoo.fr/dimphoto
    >
    >[/color]


    Comment

    • Bruce M. Thompson

      #3
      Re: InSrRev( ) problem

      > Acess 2000. Here is may problem : i want to extract the path of[color=blue]
      > my DB without thr name of the DB file, something like
      > D:\MyFolder\ I use this code but the Instrrev line is not
      > accepted : error (5) and (I try to translate) : incorect argument
      > or or procedure call. What is wrong ? (References ?)[/color]

      Try:

      Application.Cur rentProject.Pat h

      --
      Bruce M. Thompson, Microsoft Access MVP
      bthmpson@mvps.o rg (See the Access FAQ at http://www.mvps.org/access)[color=blue][color=green]
      >> NO Email Please. Keep all communications[/color][/color]
      within the newsgroups so that all might benefit.<<


      Comment

      • Alain.

        #4
        Re: InSrRev( ) problem

        Thank you Bruce,

        It works as I have rebooted the PC. I went on the Trigeminal site
        and found the explanantion of the phenomenom.
        But I still wonder which option is the best : should I use the
        1036 LCID (France) or leave it with the "option Compare Database"

        Your opinion ?

        --
        _______________ _______________ ___

        Site photo personnel :




        Comment

        • Marc

          #5
          Re: InSrRev( ) problem

          "Alain." <_@wanadoo.fr > wrote in message news:<bk7dme$re f$1@news-reader1.wanadoo .fr>...[color=blue]
          > Dear all,
          >
          > Acess 2000. Here is may problem : i want to extract the path of
          > my DB without thr name of the DB file, something like
          > D:\MyFolder\ I use this code but the Instrrev line is not
          > accepted : error (5) and (I try to translate) : incorect argument
          > or or procedure call. What is wrong ? (References ?)
          >
          > Private Sub Form_Open(Cance l As Integer)
          > Dim Bigpath As String
          > Dim SmallPath As String
          > Dim Slashloc As Integer
          >
          > Bigpath = CurrentProject. FullName ' ok
          > Slashloc = InStrRev(Chemin Complet, "\", Len(Bigpath)) ' this line
          > failed (?), Len(bigpath) works
          > Path = Left(CheminComp let, Slashloc)
          > End Sub
          >[/color]
          Alain, what is CheminComplet ?
          It looks like a not initialized variable or some other global variable
          not mentioned ..
          shouldn't that be BigPath instead ?

          Marc

          Comment

          • Alain.

            #6
            Re: InSrRev( ) problem

            Yes, CheminCimplet is Bigpath.

            --
            _______________ _______________ ___

            Site photo personnel :




            Comment

            • Michael \(michka\) Kaplan [MS]

              #7
              Re: InSrRev( ) problem

              Six of one, half a dozen of the other. :-)


              --
              MichKa [MS]

              This posting is provided "AS IS" with
              no warranties, and confers no rights.


              "Alain." <_@wanadoo.fr > wrote in message
              news:bk809r$ebh $1@news-reader3.wanadoo .fr...[color=blue]
              > Thank you Bruce,
              >
              > It works as I have rebooted the PC. I went on the Trigeminal site
              > and found the explanantion of the phenomenom.
              > But I still wonder which option is the best : should I use the
              > 1036 LCID (France) or leave it with the "option Compare Database"
              >
              > Your opinion ?
              >
              > --
              > _______________ _______________ ___
              >
              > Site photo personnel :
              >
              > http://perso.wanadoo.fr/dimphoto
              >
              >[/color]


              Comment

              Working...