Dim strSQL As String
strSQL = "SELECT tblSerialNo.SerialNo, tblSerialNo.ModelNo, tblWarrantyCard.* "
strSQL = strSQL & "FROM tblSerialNo INNER JOIN tblWarrantyCard ON tblSerialNo.RecID = tblWarrantyCard.RecID "
strSQL = strSQL & "WHERE tblSerialNo.SerialNo LIKE '%" & Me.txtSerial & "%'"
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Call conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=\\server\share\leads.mdb;", "Admin", "")
Call rs.Open(strSQL, conn, adOpenStatic, adLockOptimistic)
If rs.RecordCount > 0 Then
msgbox rs.RecordCount
Else
msgbox rs.RecordCount
End If
DoCmd.OpenForm "frmWarrSerialDisplay", acFormDS, , , acFormReadOnly
Set Forms![frmWarrSerialDisplay].Recordset = rs
rs.Close
conn.Close
|