refrence field on a table

F

Fipp

I am trying to have a button on a form where I push it and it opens the form
matching a field in the original form.

I am starting in "entry" form I click the button "addrun" it then opens the
"run" form. on both forms I have a field [formationid] I am trying to have
those fields match when I open the "run" form.

I tried the following in the where condition of the open form macro.

[Forms]![entry]![formation.formationid]=[Forms]![run]![formationid]
 
F

Fipp

I am getting a blank form. I know that data is in there to match. If i run a
query with the data in the criteria field it pulls it up correctly. When i
take the filter off the form iI can see it?
 
J

John W. Vinson

I am getting a blank form. I know that data is in there to match. If i run a
query with the data in the criteria field it pulls it up correctly. When i
take the filter off the form iI can see it?

We'd be glad to help you solve your problem. However we cannot do so with the
current information; *you* can see your computer, we cannot.

What is the Recordsource of your form?
What is the filter string?
Could you post the SQL of the query that does bring up the data correctly?

John W. Vinson [MVP]
 
F

Fipp

The form that I am trying to open up is based on the following query.

SELECT runplay.formationid, runplay.run, runplaypic.runplaypic,
formation.formationpicture, runplay.runplaypicid
FROM ((runplaypic RIGHT JOIN runplay ON runplaypic.runplaypicid =
runplay.runplaypicid) LEFT JOIN run ON runplay.run = run.runid) RIGHT JOIN
formation ON runplay.formationid = formation.formationid;

the initial form that is already opens is called "entry" and it has a field
that is called formationid.

I am trying to match the field from formationid.

I have tried the following and I get a blank result.

Forms![gameentry]![formationid] = Forms![runplayform]![formationid]


here is the query that returns what I am looking for when the "formationid"
in the gameentry form is equal to 1.


SELECT runplay.formationid, runplay.run, runplaypic.runplaypic,
formation.formationpicture, runplay.runplaypicid
FROM ((runplaypic RIGHT JOIN runplay ON runplaypic.runplaypicid =
runplay.runplaypicid) LEFT JOIN run ON runplay.run = run.runid) RIGHT JOIN
formation ON runplay.formationid = formation.formationid
WHERE (((runplay.formationid)=1));


I was reading about the stLink Criteria? Would this be a better way?
 
J

John W. Vinson

The form that I am trying to open up is based on the following query.

SELECT runplay.formationid, runplay.run, runplaypic.runplaypic,
formation.formationpicture, runplay.runplaypicid
FROM ((runplaypic RIGHT JOIN runplay ON runplaypic.runplaypicid =
runplay.runplaypicid) LEFT JOIN run ON runplay.run = run.runid) RIGHT JOIN
formation ON runplay.formationid = formation.formationid;

the initial form that is already opens is called "entry" and it has a field
that is called formationid.

I am trying to match the field from formationid.

I have tried the following and I get a blank result.

Forms![gameentry]![formationid] = Forms![runplayform]![formationid]

You cannot search a *FORM* for data in a query. You can only search a *TABLE*
for data.

THis criterion will be TRUE if both forms happen to be open to records with
the same FormationID.
here is the query that returns what I am looking for when the "formationid"
in the gameentry form is equal to 1.


SELECT runplay.formationid, runplay.run, runplaypic.runplaypic,
formation.formationpicture, runplay.runplaypicid
FROM ((runplaypic RIGHT JOIN runplay ON runplaypic.runplaypicid =
runplay.runplaypicid) LEFT JOIN run ON runplay.run = run.runid) RIGHT JOIN
formation ON runplay.formationid = formation.formationid
WHERE (((runplay.formationid)=1));

How about

WHERE (((runplay.formtionid) = Forms![gameentry]![formationid]

as a criterion?
I was reading about the stLink Criteria? Would this be a better way?

Worth a try - but again, you need to compare *the table field* to the
criterion, not compare one form reference to another form reference.

John W. Vinson [MVP]
 
Top