View Full Version : open form corresponding to control from report


darrask
02-01-2010, 12:30 AM
Good morning,

I have a students table with its report and its form.
In the report, I created a macro called on double-clicking the student's name control. The aim is to open the form corresponding to the clicked student.
I have a simple OpenForm command which works fine, and this is the code in the WHERE field:

="[Name]=" & """" & [Screen].[ActiveControl] & """"

screenshot:
http://i47.tinypic.com/2z4fxi8.png

It should act as a simple WHERE filter like: [Name]="Peter Roger" except that the name is variable and equals the clicked active control.

Now the form is opened correctly, but not at the record corresponding to the clicked student, only at the beginning.

I tried to use Char(32) and several other combinations, but I just can't get it to work.
What am I doing wrong?
Any help appreciated.

Trevor G
02-16-2010, 12:17 AM
You want your condition to go back to an ID field in the table.

Trevor

darrask
02-16-2010, 12:28 AM
No, just a Name.
In the end, I found the solution to be
[Name]=[Screen].[ActiveControl]
simply.

wiklendt
02-24-2010, 06:27 PM
spam reported

Insane_ai
02-24-2010, 09:46 PM
Have you checked the Form's properties to allow filters?

wiklendt
03-02-2010, 06:33 PM
Do you have encountered such situations:Have many of DVDs,especially some favorite,however ...

spammer reported