problem with passing caption to query

A

Annelies

The following query does not work :'(

SELECT E_Hulp_Zorg_Verlener.Voornaam
FROM E_Hulp_Zorg_Verlener, E_Overleg, R_Deelnemer_In
WHERE (((E_Overleg.ID)=[Forms]![PatientenIngeven]![Bijschrift92] And
(E_Overleg.ID)=[R_Deelnemer_In].[Overleg_ID]) AND
((E_Hulp_Zorg_Verlener.ID)=[R_Deelnemer_In].[Hulp_Zorg_ID]));

[Forms]![PatientenIngeven]![Bijschrift92](Bijschrift means Caption)
<-- this is the problem.
When i pass the parameter manually, the query works fine. Can anybody
tell me what the problem might be..

Greetzzz
Liezzzje..
 
G

GreySky

Is:

[Forms]![PatientenIngeven]![Bijschrift92]

text or a number? If text, you need to place quotation
marks around it.

Also, use SQL-92 INNER JOINS in the FROM clause instead of
creating the joins in the WHERE clause. Unless of course
you're using Oracle (blech).

David Atkins, MCP
 
G

GreySky

*feel really dumb*

Sorry you don't need quotes when passing by reference.

How long have I been doing this?

David
 
G

GreySky

If I can take you literally and assume that [Bijschrift92]
is a label control, then you need to specify the caption
property to return the caption of the label control.

Specifically:

[Forms]![PatientenIngeven]![Bijschrift92].Caption

I'm afraid otherwise I can't find your problem.

David Atkins, MCP
 
A

Annelies

Also, use SQL-92 INNER JOINS in the FROM clause instead of
creating the joins in the WHERE clause.


Followed your advice, but that doesn't solve the problem of course..
Any other suggestions?

Liezzzje..
 
G

GreySky

No, I didn't expect using inner joins would solve the
problem. What it does is help the query optimizer choose
the most efficient plan for your query (read up on hash
joins, merge joins, and the like).

Is your control a label control? What type of control is
it?

David
 

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