Hi guys! Got a problem with the following code...once code executed I get an error - "Type Mismatch"...Here is what I'm trying to accomplish..I have a Form in which user types in Customer (Cust) Number...That triggers the combo box(called TID)on that same form to populate with TIDs (tissue ids for that particular customer that user just keyed in)...To accomplish this I wrote SQL code that pulls all the TIDs for that particular customer with WHERE criterea being the imput into the Customer field on the Form. My next step is creating a recordset to which resultes of the query are assigned. Finally I'm trying to open the recordset and with it populate the combo box on my Form...here is the code:
Thank you very much! I keep on saing it all the time, but it is the truth - " What would I do without you?
Code:
Private Sub Cust_AfterUpdate()
Dim rstTid As ADODB.Recordset
Dim strSQL As String
Set rstTid = New ADODB.Recordset
strSQL = " SELECT [0001 Bin Detail].TID" & _
" FROM [0001 Bin Detail]" & _
" WHERE [0001 Bin Detail].Cust = '" & Me.Cust.Value & "';"
rstTid.Open Source:=strSQL, ActiveConnection:=CurrentProject.Connection,
CursorType:=adOpenStatic, _
Options:=adCmdText
TID.RowSourceType = "Table/Query"
Set TID.Recordset = rstTid
Set rstTid = Nothing
Thank you very much! I keep on saing it all the time, but it is the truth - " What would I do without you?