Need Help for possible Bug in Access VB for Applications?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

When I attempt to concatenate two strings the second one never gets appended:

' append wildcard to get all files and sub-directories
sSubDir = sDirName & "\" & FindData.cFileName
sSearchSubDir = sSubDir & "\*"

In another place in the form, in a different method this works fine, but for
some reason it just doesn't work here at all?

What can be done as a workaround?

thanks,

Elisha Berns
 
Hi

When I attempt to concatenate two strings the second one never gets appended:

' append wildcard to get all files and sub-directories
sSubDir = sDirName & "\" & FindData.cFileName
sSearchSubDir = sSubDir & "\*"

In another place in the form, in a different method this works fine, but for
some reason it just doesn't work here at all?

What specifically doesn't work? What are the values of cFileName,
sSubDir, and sSearchSubDir after this code has executed?

John W. Vinson[MVP]
 
Well,

What doesn't work is appending the "\*" string to end of the sSearchSubDir
string. Everything else works correctly, or seems to. FindData.cFileName
contains a directory name, which for testing is "Debug" or "Release" and the
sSubDir variable contains the string "C:\Build". So I"m trying to build the
search path "C:\Build\Debug\*" and C:\Build\Release\*". Note this is for VBA
6.3 running under Access 2000 or thereabouts.

In another place in my code appending the "\*" string works just fine, but
not here. I also tried declaring the String variables as:

Dim sSearchSubDir As String * 260

and it doesn't change anything. So what's the deal here?

Elisha
 
Elisha said:
Well,

What doesn't work is appending the "\*" string to end of the sSearchSubDir
string. Everything else works correctly, or seems to. FindData.cFileName
contains a directory name, which for testing is "Debug" or "Release" and
the
sSubDir variable contains the string "C:\Build". So I"m trying to build
the
search path "C:\Build\Debug\*" and C:\Build\Release\*". Note this is for
VBA
6.3 running under Access 2000 or thereabouts.

In another place in my code appending the "\*" string works just fine, but
not here. I also tried declaring the String variables as:

Dim sSearchSubDir As String * 260

and it doesn't change anything. So what's the deal here?

Elisha

Try setting a breakpoint on the statement:
sSearchSubDir = sSubDir & "\*"

Then try typing the statement into the immediate (debug) window and see if
it will execute.

Try using another varibale for the "\*" and appending the variable.

Also try re-typing the line.

Might also try using the Chr function to append the characters using their
ASCII codes.



....

--
 
Back
Top