Unable to filter hyperlink field

Mansoor Ahmad

Registered User.
Local time
Today, 16:09
Joined
Jan 20, 2003
Messages
140
Dear All

I am using following code to open a form on OnClick event of a command button.

myInt = InputBox("GIVE PIC NO", "GIVE!")
stWhere = "[PIC NO] = '" & myInt & "'"
DoCmd.OpenForm (frmName), acNormal, , stWhere

When I click on command button, it prompts to enter PIC NO, opens form but does not fetch any relevant data.

[PIC NO] field is a hyperlink field. It holds text like 124A, 34W etc.

If the problem is due to being hyperlink field, is there any changes I can make in above code so that it would filter hyperlink field.

Thanks
 
Have you tried the CStr() function around the hyperlink?
 
Thank for your reply.

CStr() function

honestly I do not have a clue.

Bit more help please
 
stWhere = "CStr([PIC NO]) = """ & myInt & """"
 
Good morning

Tried the way you suggested. Following error comes up

Run time error 2501
The open form action was canceled
 
Update

Here is an update on the above issue.

At last today I have managed to solve the problem with the help of someone.

Here is the solution

stWhere = "[PIC NO] Like '*" & [myInt] & "*'"
 

Users who are viewing this thread

Back
Top Bottom