"invalid qualifier" when trying to use String method

  • Thread starter Steven L via AccessMonster.com
  • Start date
S

Steven L via AccessMonster.com

I can't seem to use any string methods. Every time I try I get an "Invalid
qualifier" error.

Here's my code below. I get the error at the line that reads "If
recordFilepath.StartsWith(fileHead) Then" and the debugger points to
'recordFilepath'.

code:
====================================================
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("records")

Dim recordFilepath As String
rst.MoveFirst
For i = 1 To rst.RecordCount
recordFilepath = rst.Fields("filepath").value

If recordFilepath.StartsWith(fileHead) Then
'check what type of report it is
If recordFilepath.EndsWith("STATE-FRIENDS.pdf") Then
Me![family statement].HyperlinkAddress = "
www.blahblahblah.com"
End If
End If

rst.MoveNext
Next i
====================================================

It almost seems like the String object isn't within my references. Is that
possible? If so, what do I need to do to remedy that?

Any help will be much appreciated.

Cheers,
Steve
 
W

Wayne Morgan

Where did you find "StartsWith" and "EndsWith"? I don't recognize them. Have
you tried to create your own type? If so, then recordFilepath should be
Dim'ed as that type, not as a string. Otherwise, the functions you will need
are Len(), Left(), Right(), Mid(), and InStr().
 
R

RuralGuy

I can't seem to use any string methods. Every time I try I get an "Invalid
qualifier" error.

Here's my code below. I get the error at the line that reads "If
recordFilepath.StartsWith(fileHead) Then" and the debugger points to
'recordFilepath'.

code:
====================================================
Dim rst As DAO.Recordset
Set rst = CurrentDb.OpenRecordset("records")

Dim recordFilepath As String
rst.MoveFirst
For i = 1 To rst.RecordCount
recordFilepath = rst.Fields("filepath").value

If recordFilepath.StartsWith(fileHead) Then
'check what type of report it is
If recordFilepath.EndsWith("STATE-FRIENDS.pdf") Then
Me![family statement].HyperlinkAddress = "
www.blahblahblah.com"
End If
End If

rst.MoveNext
Next i
====================================================

It almost seems like the String object isn't within my references. Is that
possible? If so, what do I need to do to remedy that?

Any help will be much appreciated.

Cheers,
Steve

You Dimensioned recordFilepath As String and yet you are using it
as if it is an object or collection. Not surprising it pops an error.
Are StartsWith and EndsWith user defined functions of yours?
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
S

Steven L via AccessMonster.com

I got those methods from here:
http://msdn.microsoft.com/library/d.../cpref/html/frlrfSystemStringMethodsTopic.asp


Am I not allowed to use these methods? I noticed String belonged to the
System package so I referenced System.dll. Didn't make a difference and still
couldn't use any String methods, so I ran:
regsvr32 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll
and this error popped up:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll was loaded, but the
DllRegisterServer entry point was not found.
This file cannot be registered.

What's going on?

Looks like I'll have to write my own StartsWith and EndsWith methods :/



Wayne said:
Where did you find "StartsWith" and "EndsWith"? I don't recognize them. Have
you tried to create your own type? If so, then recordFilepath should be
Dim'ed as that type, not as a string. Otherwise, the functions you will need
are Len(), Left(), Right(), Mid(), and InStr().
I can't seem to use any string methods. Every time I try I get an "Invalid
qualifier" error.
[quoted text clipped - 32 lines]
Cheers,
Steve
 
D

Douglas J Steele

The page you cite is for .Net, and Access doesn't support .Net at this time
(nor, from the sounds of it, will it in the next version)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Steven L via AccessMonster.com said:
I got those methods from here:
http://msdn.microsoft.com/library/d.../cpref/html/frlrfSystemStringMethodsTopic.asp


Am I not allowed to use these methods? I noticed String belonged to the
System package so I referenced System.dll. Didn't make a difference and still
couldn't use any String methods, so I ran:
regsvr32 C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll
and this error popped up:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll was loaded, but the
DllRegisterServer entry point was not found.
This file cannot be registered.

What's going on?

Looks like I'll have to write my own StartsWith and EndsWith methods :/



Wayne said:
Where did you find "StartsWith" and "EndsWith"? I don't recognize them. Have
you tried to create your own type? If so, then recordFilepath should be
Dim'ed as that type, not as a string. Otherwise, the functions you will need
are Len(), Left(), Right(), Mid(), and InStr().
I can't seem to use any string methods. Every time I try I get an "Invalid
qualifier" error.
[quoted text clipped - 32 lines]
Cheers,
Steve
 
S

Steven L via AccessMonster.com

Ah, I see. Thanks very much. Got round it by writing my own methods with Mid,
Len and StrComp, and then ran straight into another problem whilst trying to
run a query, this time of the "You cancelled the previous operation" type.
Currently reading up on that.

Once again, thanks very much.

Steve L
The page you cite is for .Net, and Access doesn't support .Net at this time
(nor, from the sounds of it, will it in the next version)
I got those methods from here:
http://msdn.microsoft.com/library/d.../cpref/html/frlrfSystemStringMethodsTopic.asp

Am I not allowed to use these methods? I noticed String belonged to the
System package so I referenced System.dll. Didn't make a difference and still
[quoted text clipped - 19 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top