-
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.
-
No success yet can somebody please help.
Thanks.
:mad:
-
Just incase you overlooked it -
Are you sure your string is enclosed with apostrophes eg -
myString = "'" & txtCust.text & "'"
DataEnvironment1.contacts myString
-
To Bigley tried it.
No success. :rolleyes:
How must my data type (host data type) look at my properties tab in my command at my dataenvironment.Remember i gave my parameter as a "?".
Thanks. :D
-
No success yet.
P L E A S E H E L P !!!!!!!
:mad: :confused: