open form with value

Thedon123

Registered User.
Local time
Today, 10:30
Joined
Sep 11, 2002
Messages
98
I am trying to open this form so that it displays the criteria the user has selected.

The 2 criteria needed are C_Number and C_REP.

The problem is i can only get it to open with C-NUMBER criteria it does not take into account the C_rep criteria.

the code i used is below.

how do i get it to open the form searching both criterias?

Private Sub Cl_NUMBER_Click()

Dim ClmNoSearch As String
Dim stLinkCriteria As String
Dim ClmRepSearch As String

ClmNoSearch = Me!C_NUMBER
ClmRepSearch = Me!C_REP

DoCmd.OpenForm "Please Wait", acNormal, "", "", , acNormal

DoCmd.OpenForm "Mod C", acNormal, "ClmNoSearch" +"ClmRepSearch", , , acNormal

DoCmd.Close acForm, "Please Wait"

End Sub
 
Hi there

You haven't defined your search criteria correctly.

Try this:

stLinkCriteria = "[ClmNoSearch] = " & Me!C_NUMBER & " and [ClmRepSearch] = " & Me!C_REP

DoCmd.OpenForm "Mod C", , stLinkCriteria


hth

shay :cool:
 

Users who are viewing this thread

Back
Top Bottom