OpenForm Filter

MartijnAn

Registered User.
Local time
Today, 13:57
Joined
Sep 30, 2004
Messages
51
Hi All,

I have a problem and I can't figure out what I am doing wrong, I have a code:

Private Sub Button4_Click()
Dim compl As String
compl = name1
DoCmd.OpenForm "form1", , , "Field1=" & name1
DoCmd.Close acForm, "form2"
End Sub

Now everytime I click on this button and I enter a value in textbox(name1) it askes for a parameter! This is the only field in the form (form1) where I have this problem by the way. With the other fields it doesn't ask for a parameter. Does anyone know what might be the problem?
 
Before you open the form, are you passing a value into the name1 field. If not, then it will ask for the value when you open the form. If the value is being passed, then check the control name of the field it is being passed too. Is it called Field1?

Why are you setting the compl dimension to name1 and then asking for Field1 to be name1 too?
 
Well, the where-option here has something to do if it is a character or numeric value, I figured out. I get no message if I enter:

"Field1" Like compl

But now, I don't get any results (I typed the exact word for name1)
 

Users who are viewing this thread

Back
Top Bottom