Problems with "{" "}"

pastor399

New member
Local time
Today, 15:45
Joined
Feb 22, 2012
Messages
1
Hi, hope someone can help me, i have searched wide and far and found nothing, not even sure what terms i should be searching for to help me with this.

I have a database which uses a linked source that is in fact another database containing a large amount of information on CCTV inspections. In this database are fields that contain ID numbers of various kinds, all of these ID numbers are enclosed in { } brackets, i.e "{B6C20718-466D-434A-A3BE-F6CDC4E9462E}".

I need to use these ID numbers in my front end database in some VBA code, but if i try to read the value of the ID number fields using this code
Code:
varID = [SI_ID].value
the varID variable which is declared as a String returns a value of "???????".
I have found and believe this problem has to do with MS Access recognizing "{B6C20718-466D-434A-A3BE-F6CDC4E9462E}" or anything enclosed in {} as a GUID or something similar.

I need a way to store the string value of the ID numbers in a variable. I can get it to work using a text box on the form, and using the .SetFocus and .Text methods, but having to display a text box containing back end data that a user does not need to see is less than ideal.
 
Try to strip away { and }:

Code:
varID = Mid([SI_ID],2, Len([SI_ID])-2)

JR
 
If that data is stored as a GUID datatype there are two inbuilt functions

GUIDfromString()
and
stringfromGUID()

That might help.
 

Users who are viewing this thread

Back
Top Bottom