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]
 
Back
Top