Using GUIDS in Form VBA Code

  • Thread starter Thread starter Ed Warren
  • Start date Start date
E

Ed Warren

Two tables with related forms, common key [ProcedureID] of type GUID

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmProcedure_new"

stLinkCriteria = "[ProcedureID]= " & Me![ProcedureID]
DoCmd.OpenForm stDocName, , , stLinkCriteria


The code above does not work for the GUID field I have tried several
combinations of calling StringFromGUID() AND GUIDFromString() and have not
found the right combination.

This can't be this hard, so I've missed some very simple concept here.

Any help greatly apprecieate.

Thanks,

Ed Warren
 
Lookup stringfromguid on msdn

I think your line of code should look like this:

stLinkCriteria = "stringfromguid([ProcedureID])= " & Me![ProcedureID]
 

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

Back
Top