Using GUID as Filter for Report

G

Guest

I am trying to Filter a report with a GUID as the uniqueIdentifier. How is
this done? I can only filter using a secondary Unique string.

The code I would like to have work is:

Dim stDocName As String

stDocName = "Labels tblParts"
DoCmd.OpenReport stDocName, acPreview, "[PartID]=" & Me.PartID

Thankyou in advance for your help.
 
P

Peter Yang [MSFT]

Hello Alan,

As I know, this feature is not support. However, you could try to use ADO
to perform such kind of job:

Dim myGUid as GUID = GUID.NewGuid

mySQL = "UPDATE ITEMS SET Title="New Record No. 1", WHERE KeyID ='" &
myGUID.ToString & "'")

197916 How To Use GUIDs w/ Access, SQL 6.5 and SQL 7
http://support.microsoft.com/default.aspx?scid=kb;EN-US;197916

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemguidclassnewguidtopic.asp

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.


=====================================================

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


--------------------
 
G

Guest

Hi Giorgio,

I can't remember seeing a notification and have only just seen your Post.

I will try this. Thank you.

--
Regards,

Alan


giorgio rancati said:
Hi Alan,
try this
----
Dim stDocName As String
Dim strGUID As String

strGUID = StringFromGUID(Me.PartID)
strGUID = Mid(strGUID, 7)
strGUID = Left(strGUID, Len(strGUID) - 1)

stDocName = "Labels tblParts"
DoCmd.OpenReport stDocName, acPreview, , "[PartID]='" & strGUID & "'"
----

StringFromGUID Function
http://msdn.microsoft.com/library/d...ry/en-us/vbaac10/html/acfctStringFromGUID.asp


bye
--
Giorgio Rancati
[Office Access MVP]

steel said:
I am trying to Filter a report with a GUID as the uniqueIdentifier. How is
this done? I can only filter using a secondary Unique string.

The code I would like to have work is:

Dim stDocName As String

stDocName = "Labels tblParts"
DoCmd.OpenReport stDocName, acPreview, "[PartID]=" & Me.PartID

Thankyou in advance for your help.
 

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