open form corresponding to control from report

darrask

Registered User.
Local time
Today, 11:44
Joined
Feb 1, 2010
Messages
11
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:
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.
 
You want your condition to go back to an ID field in the table.

Trevor
 
No, just a Name.
In the end, I found the solution to be
[Name]=[Screen].[ActiveControl]
simply.
 
Have you checked the Form's properties to allow filters?
 

Users who are viewing this thread

Back
Top Bottom