txgeekgirl
Registered User.
- Local time
- Today, 06:41
- Joined
- Jul 31, 2008
- Messages
- 187
RecordSets - You love them - you hate them... I need help with them.
I need this code to find the first record so I can fill a form. and then my EU can click EDIT - (unlock the form) and Update the record. I have code for all of that - it's the recordset giving me something to work with I do not have.
I need this code to find the first record so I can fill a form. and then my EU can click EDIT - (unlock the form) and Update the record. I have code for all of that - it's the recordset giving me something to work with I do not have.
Code:
Sub TypeCB_AfterUpdate()
Dim rst As Object
Dim con As Object
Dim mySql As String
Set con = Application.CurrentProject.Connection
mySql = "SELECT * FROM [Records_Disposition]" + _
"WHERE [Type] = " & Me!TypeCB + ";"
Set rst = CreateObject("ADODB.Recordset")
rst.Open mySql, con, adOpenKeyset
rst.FindFirst
MsgBox mySql
' Close the recordset and the database.
rs.Close
MsgBox "one"
If rst.NoMatch Then
warning "No matching records", "TypeCB_AfterUpdate"
Set rs = Nothing
Set con = Nothing
End If
End Sub