I am setting up a form using a couple combo boxes. I want to populate a text box or 2 from the item record selected from one of the comboBox. Below is the code I am using. I have commented out where I am trying to transfer the value to the form, and try focusing on the query. When I run this code I get a type mismatch. Thanks in advance for your help.
John
rivate Sub cbx_SlideNo_Change()
Me.Refresh
Dim StringSQL As String
Dim rs As Recordset
StringSQL = "SELECT Slides.[SlideTitle] "
StringSQL = StringSQL & "FROM Slides "
StringSQL = StringSQL & "WHERE (((Slides.[Deck])=""" & cbx_Deck & """) AND ((Slides.[SlideNo])=" & cbx_SlideNo & "));"
Debug.Print StringSQL
'rs.OpenRecordset(StringSQL) as Recordset
'rs.OpenRecordset
DoCmd.RunCommand "StringSQL"
'If rs.EOF Then
' MsgBox "No Data"
' Else
' rs.MoveFirst
' txt_SlideTitle.Value = rs!SlideTitle
'End If
End Sub