elamberton
New member
- Local time
- Today, 07:26
- Joined
- Jan 11, 2000
- Messages
- 5
Public Sub SearchField3(Find As String, Co As String)
Dim strSQL As String
Dim db As Database
Dim rs As Recordset
strSQL = "Customers"
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL)
With rs
Do While rs.NoMatch = True
.MoveNext
.FindFirst "CustomerID = '" & Find &"'"
Loop
Co = rs!CompanyName
End With
End Sub
this is the function I have written to fill in the Co feild. However, it doesn't work. Any suggestions? It doesn't give me any errors when I run the code.
Dim strSQL As String
Dim db As Database
Dim rs As Recordset
strSQL = "Customers"
Set db = CurrentDb()
Set rs = db.OpenRecordset(strSQL)
With rs
Do While rs.NoMatch = True
.MoveNext
.FindFirst "CustomerID = '" & Find &"'"
Loop
Co = rs!CompanyName
End With
End Sub
this is the function I have written to fill in the Co feild. However, it doesn't work. Any suggestions? It doesn't give me any errors when I run the code.