Open form with codition

  • Thread starter Thread starter a
  • Start date Start date
A

a

Thank You

If I have 2 forms

I want to open second form with condition

If txtgroup in the first form equal txtgroup in the second from

I want the answer with txtgroup value

Text value

Number Value

Date Value



I have this code for Numeric value

===============

If DCount("[IDClient]", "tblClient", "[IDClient] = " & Me.IDClient) > 0 Then

'code here to open frm2ndform

DoCmd.OpenForm "frmclient", , , "([IDClient]=" & Me.IDClient & ")"

End If

=================
 
You say you want to open the second form on condition but you base the
condition on "If txtgroup in the first form equal txtgroup in the second from"

The seconf form HAS TO BE OPEN to read it.
 
Text:
If DCount("[IDClient]", "tblClient", "[IDClient] = '" & Me.IDClient & "'")

Date:
If DCount("[IDClient]", "tblClient", "[IDClient] = #" & Me.IDClient & "#")

Do the same for the OpenForm code. Here is the basic rule:
Numeric and Boolean- No delimiters
Text - Single or double qoutes
Date - Pound Sign
--
Dave Hargis, Microsoft Access MVP


a said:
Thank You

If I have 2 forms

I want to open second form with condition

If txtgroup in the first form equal txtgroup in the second from

I want the answer with txtgroup value

Text value

Number Value

Date Value



I have this code for Numeric value

===============

If DCount("[IDClient]", "tblClient", "[IDClient] = " & Me.IDClient) > 0 Then

'code here to open frm2ndform

DoCmd.OpenForm "frmclient", , , "([IDClient]=" & Me.IDClient & ")"

End If

=================
 
Back
Top