Sal, I get erros either way. Here is what I am trying, the first part is the old way that worked, but not with long strings, the error messages for your suggestions farther down. I used the DAO approach:
'***The below works, but only for smaller strings
'Me.RecordSource = Forms!F_ToolingTypeSelectionForReport!tbxSQL_Strin g
'Me.tbxCriteria.caption = Forms!F_ToolingTypeSelectionForReport!tbxLable_Str ing
'************************************************* **********
Me.tbxCriteria.caption = "TEST"
'MsgBox "The report's record sources is: " & Forms!F_ToolingTypeSelectionForReport!tbxSQL_Strin g
Dim dbs As Database, rst As Recordset, strSQL As String
Set dbs = CurrentDb()
strSQL = Forms!F_ToolingTypeSelectionForReport!tbxSQL_Strin g
Set rst = dbs.OpenRecordset(strSQL)
If rst.BOF = True Then
MsgBox "No Detail found!"
ElseIf rst.BOF = False Then
'Me.Recordset = rst '**Gives me: Method or data Member Not Found
Me.RecordSource = rst '**Gives me: Type Mismatch
End If
rst.Close
Set dbs = Nothing
|