Opening a Form and displaying records based on two criterions

Access_Help

Registered User.
Local time
Yesterday, 17:56
Joined
Feb 12, 2005
Messages
136
Hi!

OK, I have two forms:

Form 1: Courses

Form 2: Mark Grid


The user select the class from [Combo28] for the unit already in [Textbox named Unit] from Form 1 and wants to list all the students for that particular class and unit in form 2.

I have tried god knows how many different codes. I've been playing with:

DoCmd.OpenForm "Mark Grid", , , "[Text43]=" & Me![Combo28] & " AND [Text17]= '" & Me![Unit] & "'"

But with no luck.

Can anyone help please!!!!

Thanks
 
If they both are Text, you need to concatenate them like.
Code:
DoCmd.OpenForm "Mark Grid", , , "[Text43] = [COLOR=Red][B]'[/B][/COLOR]" & Me![Combo28] & "[COLOR=Red][B]' [/B][/COLOR]AND [Text17]=[COLOR=Red][B] '[/B][/COLOR]" & Me![Unit] & "[COLOR=Red][B]'[/B][/COLOR]"
 
thank you!
 

Users who are viewing this thread

Back
Top Bottom