Open a form based on meeting two criteria ID (1 Viewer)

shery1995

Member
Local time
Today, 10:50
Joined
May 29, 2010
Messages
71
Hi All

I am trying to open a form with following code:

DoCmd.OpenForm "frmClientMatter" ,,,"[ClientID]=" & Me. ClientID &"'"& and "[MatterID]=" & Me.MatterID

But code does not work.

Any help suggestion will be much appreciated.

A Munir

Please note both (ClientID and MatterID) are numeric fields.
 

plog

Banishment Pending
Local time
Today, 04:50
Joined
May 11, 2011
Messages
11,646
If they are both numeric, there's no need for a single quote. Even if they aren't, quotes need to work in pairs.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:50
Joined
Oct 29, 2018
Messages
21,474
Hi. Try it this way:
Code:
DoCmd.OpenForm "frmClientMatter", , ,"[ClientID]=" & Me. ClientID &" and [MatterID]=" & Me.MatterID
Edit: Oops, too slow...
 

shery1995

Member
Local time
Today, 10:50
Joined
May 29, 2010
Messages
71
Hi. Try it this way:
Code:
DoCmd.OpenForm "frmClientMatter", , ,"[ClientID]=" & Me. ClientID &" and [MatterID]=" & Me.MatterID
Edit: Oops, too slow...
Thank you so much it works fine.
 

Users who are viewing this thread

Top Bottom