Using GUID in a query

S

sharper

I have a replicated database, using Replication ID (rather than Long
Interger) for the primary keys.

I am trying to use the Replication ID (GUID) in a select query, referencing
an open subform. When i run the query with the form closed and enter the
guid in the parameters box that pop up there is no problem, but it will not
run properly referencing the open form - I just get blank results as it seems
the query is interpreting the inpt as a string.

I have tried to use GUIDfromString as follows "GUIDfromString
([forms]![student basic]![student suggested courses]![studentid]" but I get
an error saying that the expression is too long to evaluate.

Help appreciated!!!!
 
J

Jeff Boyce

Not sure about GUID specifics, but the expression for referring to a form's
control only has three elements (unless you are referring to a subform's
control).

Forms!YourFormName!YourControlName
 
S

Sylvain Lafontaine

GUID - a good idea translated into a bad one by the MS staff. For a start:

http://www.trigeminal.com/usenet/usenet011.asp
http://www.trigeminal.com/lang/1033/codes.asp?ItemID=9
http://www.trigeminal.com/code/guids.bas

For accessing the controls on your subform, [student suggested courses] is
probably the name of your subform control and is not the subform itself; so
you must add the property .Form before accessing the controls on your
subform, something like:

[forms]![student basic]![student suggested courses].Form![studentid]

S. L.
 
S

sharper

Thanks for your reply.

Referencing the control is not the issue, I don't think - I can use the
Expression Builder to do that and it fills the control's identifier for me.

The problem is that the query is not using the information from the control
on the subform correctly.

I think I'm right that query needs to evaluate a GUID using "{guid {.....}}"
- the problem is I cant use this with the identifier for the control.

When I type something like "{guid {[Forms]![student basic]![studentid]}} (or
other permutation it tells me that the GUID is not in the right format. When
I try to use {guid {StringfromGUID([Forms]!.....)}} it tells me that the
expression is too complex to evaluate.

I losing what little hair I have left.

Can you help again or does anyone else have experience of doing this?

Thanks.



Sylvain Lafontaine said:
GUID - a good idea translated into a bad one by the MS staff. For a start:

http://www.trigeminal.com/usenet/usenet011.asp
http://www.trigeminal.com/lang/1033/codes.asp?ItemID=9
http://www.trigeminal.com/code/guids.bas

For accessing the controls on your subform, [student suggested courses] is
probably the name of your subform control and is not the subform itself; so
you must add the property .Form before accessing the controls on your
subform, something like:

[forms]![student basic]![student suggested courses].Form![studentid]

S. L.

sharper said:
I have a replicated database, using Replication ID (rather than Long
Interger) for the primary keys.

I am trying to use the Replication ID (GUID) in a select query,
referencing
an open subform. When i run the query with the form closed and enter the
guid in the parameters box that pop up there is no problem, but it will
not
run properly referencing the open form - I just get blank results as it
seems
the query is interpreting the inpt as a string.

I have tried to use GUIDfromString as follows "GUIDfromString
([forms]![student basic]![student suggested courses]![studentid]" but I
get
an error saying that the expression is too long to evaluate.

Help appreciated!!!!
 
S

Sylvain Lafontaine

I'm sorry but I never used GUID, so I can't help you any longer.

If I have some time tomorrow, I will try to make some tests but a possible
solution for you might be to add a second column to your table and store
there the string representations of your GUIDs. This will give you the
possibility of easily making Select queries; until you find the answer to
this enigma.

S. L.

sharper said:
Thanks for your reply.

Referencing the control is not the issue, I don't think - I can use the
Expression Builder to do that and it fills the control's identifier for
me.

The problem is that the query is not using the information from the
control
on the subform correctly.

I think I'm right that query needs to evaluate a GUID using "{guid
{.....}}"
- the problem is I cant use this with the identifier for the control.

When I type something like "{guid {[Forms]![student basic]![studentid]}}
(or
other permutation it tells me that the GUID is not in the right format.
When
I try to use {guid {StringfromGUID([Forms]!.....)}} it tells me that the
expression is too complex to evaluate.

I losing what little hair I have left.

Can you help again or does anyone else have experience of doing this?

Thanks.



Sylvain Lafontaine said:
GUID - a good idea translated into a bad one by the MS staff. For a
start:

http://www.trigeminal.com/usenet/usenet011.asp
http://www.trigeminal.com/lang/1033/codes.asp?ItemID=9
http://www.trigeminal.com/code/guids.bas

For accessing the controls on your subform, [student suggested courses]
is
probably the name of your subform control and is not the subform itself;
so
you must add the property .Form before accessing the controls on your
subform, something like:

[forms]![student basic]![student suggested courses].Form![studentid]

S. L.

sharper said:
I have a replicated database, using Replication ID (rather than Long
Interger) for the primary keys.

I am trying to use the Replication ID (GUID) in a select query,
referencing
an open subform. When i run the query with the form closed and enter
the
guid in the parameters box that pop up there is no problem, but it will
not
run properly referencing the open form - I just get blank results as it
seems
the query is interpreting the inpt as a string.

I have tried to use GUIDfromString as follows "GUIDfromString
([forms]![student basic]![student suggested courses]![studentid]" but I
get
an error saying that the expression is too long to evaluate.

Help appreciated!!!!
 
S

Sylvain Lafontaine

Maybe the following article will put some light:
http://support.microsoft.com/kb/210612/en-us

S. L.

Sylvain Lafontaine said:
I'm sorry but I never used GUID, so I can't help you any longer.

If I have some time tomorrow, I will try to make some tests but a possible
solution for you might be to add a second column to your table and store
there the string representations of your GUIDs. This will give you the
possibility of easily making Select queries; until you find the answer to
this enigma.

S. L.

sharper said:
Thanks for your reply.

Referencing the control is not the issue, I don't think - I can use the
Expression Builder to do that and it fills the control's identifier for
me.

The problem is that the query is not using the information from the
control
on the subform correctly.

I think I'm right that query needs to evaluate a GUID using "{guid
{.....}}"
- the problem is I cant use this with the identifier for the control.

When I type something like "{guid {[Forms]![student basic]![studentid]}}
(or
other permutation it tells me that the GUID is not in the right format.
When
I try to use {guid {StringfromGUID([Forms]!.....)}} it tells me that the
expression is too complex to evaluate.

I losing what little hair I have left.

Can you help again or does anyone else have experience of doing this?

Thanks.



Sylvain Lafontaine said:
GUID - a good idea translated into a bad one by the MS staff. For a
start:

http://www.trigeminal.com/usenet/usenet011.asp
http://www.trigeminal.com/lang/1033/codes.asp?ItemID=9
http://www.trigeminal.com/code/guids.bas

For accessing the controls on your subform, [student suggested courses]
is
probably the name of your subform control and is not the subform itself;
so
you must add the property .Form before accessing the controls on your
subform, something like:

[forms]![student basic]![student suggested courses].Form![studentid]

S. L.

I have a replicated database, using Replication ID (rather than Long
Interger) for the primary keys.

I am trying to use the Replication ID (GUID) in a select query,
referencing
an open subform. When i run the query with the form closed and enter
the
guid in the parameters box that pop up there is no problem, but it
will
not
run properly referencing the open form - I just get blank results as
it
seems
the query is interpreting the inpt as a string.

I have tried to use GUIDfromString as follows "GUIDfromString
([forms]![student basic]![student suggested courses]![studentid]" but
I
get
an error saying that the expression is too long to evaluate.

Help appreciated!!!!
 
S

Sylvain Lafontaine

And this one:
http://support.microsoft.com/kb/282977/en-us

S. L.

Sylvain Lafontaine said:
Maybe the following article will put some light:
http://support.microsoft.com/kb/210612/en-us

S. L.

Sylvain Lafontaine said:
I'm sorry but I never used GUID, so I can't help you any longer.

If I have some time tomorrow, I will try to make some tests but a
possible solution for you might be to add a second column to your table
and store there the string representations of your GUIDs. This will give
you the possibility of easily making Select queries; until you find the
answer to this enigma.

S. L.

sharper said:
Thanks for your reply.

Referencing the control is not the issue, I don't think - I can use the
Expression Builder to do that and it fills the control's identifier for
me.

The problem is that the query is not using the information from the
control
on the subform correctly.

I think I'm right that query needs to evaluate a GUID using "{guid
{.....}}"
- the problem is I cant use this with the identifier for the control.

When I type something like "{guid {[Forms]![student basic]![studentid]}}
(or
other permutation it tells me that the GUID is not in the right format.
When
I try to use {guid {StringfromGUID([Forms]!.....)}} it tells me that the
expression is too complex to evaluate.

I losing what little hair I have left.

Can you help again or does anyone else have experience of doing this?

Thanks.



:

GUID - a good idea translated into a bad one by the MS staff. For a
start:

http://www.trigeminal.com/usenet/usenet011.asp
http://www.trigeminal.com/lang/1033/codes.asp?ItemID=9
http://www.trigeminal.com/code/guids.bas

For accessing the controls on your subform, [student suggested courses]
is
probably the name of your subform control and is not the subform
itself; so
you must add the property .Form before accessing the controls on your
subform, something like:

[forms]![student basic]![student suggested courses].Form![studentid]

S. L.

I have a replicated database, using Replication ID (rather than Long
Interger) for the primary keys.

I am trying to use the Replication ID (GUID) in a select query,
referencing
an open subform. When i run the query with the form closed and enter
the
guid in the parameters box that pop up there is no problem, but it
will
not
run properly referencing the open form - I just get blank results as
it
seems
the query is interpreting the inpt as a string.

I have tried to use GUIDfromString as follows "GUIDfromString
([forms]![student basic]![student suggested courses]![studentid]" but
I
get
an error saying that the expression is too long to evaluate.

Help appreciated!!!!
 
J

John Spencer (MVP)

I believe that

StringFromGuid adds the {Guid etc to the string that is created. So if you
do, you will end up with {guid {guid ...


SNIP
me.
The problem is that the query is not using the information from the
control
on the subform correctly.

I think I'm right that query needs to evaluate a GUID using "{guid
{.....}}"
- the problem is I cant use this with the identifier for the control.

When I type something like "{guid {[Forms]![student basic]![studentid]}}
(or
other permutation it tells me that the GUID is not in the right format.
When
I try to use {guid {StringfromGUID([Forms]!.....)}} it tells me that the
expression is too complex to evaluate.

I losing what little hair I have left.

Can you help again or does anyone else have experience of doing this?

Thanks.
 
Top