Open Form with filter based on unbound Combo Box

psatkar

Registered User.
Local time
Today, 15:51
Joined
May 27, 2008
Messages
17
Hello,

I am using Access 2007. I have developed a form say "Form1" which also has a sub-form in datasheet view. On form header I have an unbound combo-box (cboxGoToAccount). When I select a particular entry in combo-box, I have written AfterUpdate event so that it will set filter to the form's RecordSource and even sub-form will show only corresponding records based on the filter. Everything works as expected in this particular form.

I have another form say "Form2" which is in continuous form layout. One of the columns from this form is the field which is "similar" (basically Account_Code) to the field available in Filter Combo-box mentioned in the above form. I have kept hyperlink on this column in Form2 so that it will open Form1. Now, I want to open Form1 such that the form gets automatically filtered based on the field available in hyperlink column (basically Account_ID in this case).

I tried writing a macro in the hyperlink field with action as "OpenForm" and writing where condition as "where Forms!Form1.cboxGoToAccount = " & Me.Acct_id. However, while executing this macro, it does not recognise the cboxGoToAccount contrl from Form1.

Is there any way, I can achieve this functionality?

Thanks in advance...

Regards/psatkar
 

Users who are viewing this thread

Back
Top Bottom