Open a form from a form with 2 conditions

ohi

Registered User.
Local time
Today, 16:40
Joined
Nov 25, 2009
Messages
19
Hi, I have a form where all of my data is showing for a particular record, from that form I have a button that will open a new form where a form letter with that data is placed.

The problem is that I need to only show the matching form to that form which is matched by 2 conditions the CN and the SN need to match, right now I have it so that the CN is matching, but then you have to scroll through the records to find the matching SN. I just want the matching record to show.

I've searched for help but can't seem to find any answers.

Any help would be greatly appreciated.
 
The WhereCondition argument of the OpenForm command can be a compound expression: A = OneValue AND B = AnotherValue
 
I've tried and got countless errors, so I'm obviously not doing something correctly.

I can do one or the other

="[SN]=" & "'" & [SN] & "'"

="[CN]=" & "'" & [CN] & "'"

but I guess I'm just lost with combining the two in the OpenForm argument of the embedded macro.
 
Last edited:
"[SN]= '" & [SN] & "' and [CN]='" & [CN] & "'"
...assuming both values are strings.
 
That's not working either :(

The form is pointed to the correct form I need to open, and it's opening it fine, it's just not displaying the correct records, it's not even filtering them, it's showing all of them.
 
Can you post all of the appropriate code you are using?
 

Users who are viewing this thread

Back
Top Bottom