use this code below to find record on the form. is working fine without error. my problem when it show me msgbox "record found" it doesn't call my client record on my client inforamtion form. i think i need to add more code to pull my client record if it show that the record exist.
Private Sub Command1_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jsdegard\Desktop\PieceWeight.mdb;User Id=admin;Password=;"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "Select * From tblmain Where partno = '" & Text0.Text & "'", cn, adOpenKeyset, adLockOptimistic, -1
If rs.BOF And rs.EOF Then
MsgBox "No records match the current criteria!", vbCritical
Else
MsgBox "Record Found!", vbInformation
End If
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
End Sub
Private Sub Command1_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\jsdegard\Desktop\PieceWeight.mdb;User Id=admin;Password=;"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
rs.Open "Select * From tblmain Where partno = '" & Text0.Text & "'", cn, adOpenKeyset, adLockOptimistic, -1
If rs.BOF And rs.EOF Then
MsgBox "No records match the current criteria!", vbCritical
Else
MsgBox "Record Found!", vbInformation
End If
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
End Sub