|
-
Feb 6th, 2000, 03:31 PM
#1
Thread Starter
Member
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.
-
Feb 8th, 2000, 02:09 PM
#2
Thread Starter
Member
No success yet can somebody please help.
Thanks.
-
Feb 8th, 2000, 05:58 PM
#3
Hyperactive Member
Just incase you overlooked it -
Are you sure your string is enclosed with apostrophes eg -
myString = "'" & txtCust.text & "'"
DataEnvironment1.contacts myString
-
Feb 8th, 2000, 06:18 PM
#4
Thread Starter
Member
-
Feb 9th, 2000, 02:35 PM
#5
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|