Why do i get a "type mismatch error" when i pass a "string" as a parameter.
Here is my code:
_____________________________________________

Private Sub cmdReport_Click()

'The If block closes the recordset if it was previously open before
'running the parameterized query.
With DataEnvironment1
If .rsContacts.State = adStateOpen Then
.rsContacts.Close
End If
' This passes in the value entered into the TextBox.
.Contacts txtCust.Text ' My Parameter

' This If block checks to determine if any records are returned
' by the parameter. Then it shows a report if records are returned.
' Or displays a Message Box if no records are returned.

If .rsContacts.RecordCount > 0 Then
' Degbug shows a number of records in the data source
Set rptContact.DataSource = DataEnvironment1

rptContact.Show
Else
MsgBox "No Titles found" & txtCust.Text
End If
End With
End Sub
_____________________________________________

If my string is a value it works ok.I have also tried changing my parameters datatypes at the property pages.NO success.I hope i did it right.

Can anybody help me please?

Thanks.