Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Time Error '3464'

Status
Not open for further replies.

olushow

MIS
Jul 26, 2006
84
US
I am attempting to filter out a subform when I select a value in a combo box, My problem is that whatever value I select I get the following error message: - RunTime error 3464 - Data type mismatch, and the debugger points to the 4th line in my code. Not sure where the data type mismatch is. Could the issue be with the Unit_Description field? It's just a short text field type in the table it resides in.



Private Sub cboUnitDescription_AfterUpdate()
Dim myDescription As String
myDescription = "Select * from tblTraining where ([Unit_Description] = " & Me.cboUnitDescription & ")"
Me.tblSubTrainingForm.Form.RecordSource = myDescription
Me.tblSubTrainingForm.Requery
End Sub




 
Try:
[tt]
myDescription = "Select * from tblTraining where ([Unit_Description] = [highlight #FCE94F]'[/highlight]" & Me.cboUnitDescription & "[highlight #FCE94F]'[/highlight])"
[/tt]


---- Andy

There is a great need for a sarcasm font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top