If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Got this code to work, How can I modify it.
How could I modify the code below to go to the record if it was partial. For
example: If I was looking for the name Brian or Bryan but wasnt sure, I could enter into the cboMoteTo "br" and it would navigate to the first record br. Thanks, any help would be greatly appreciated. Private Sub cboMoveTo_AfterUpdate() Dim rs As DAO.Recordset If Not IsNull(Me.cboMoveTo) Then 'Save before move. If Me.Dirty Then Me.Dirty = False End If 'Search in the clone set. Set rs = Me.RecordsetClone rs.FindFirst "[remarks] = """ & Me.cboMoveTo & """" If rs.NoMatch Then MsgBox "Not found: filtered?" Else 'Display the found record in the form. Me.Bookmark = rs.Bookmark End If Set rs = Nothing End If End Sub |
#2
|
|||
|
|||
Got this code to work, How can I modify it.
This code works, Which
Dirk Goldgar, MS Access MVP www.datagnostics.com Understood my question better than I asking It. Thanks Dirk, The code worked Fine, I thought I better post it here If others were trying to search the forum for a simular type situation but wasnt considering filtering records when navigating through records vs. filtering records. Something like this: '----- start of example code ------ Private Sub txtSearchRemarks_AfterUpdate() Dim strSought As String Const Q As String = """" Const QQ As String = Q & Q strSought = Me.txtSearchRemarks & vbNullString If Len(strSought) 0 Then With Me.Recordset ..FindFirst "Remarks Like " & Q & "*" & _ Replace(strSought, Q, QQ) & "*" & Q If .NoMatch Then MsgBox "Not found." End If End With End If End Sub '----- end of example code ------ -- Dirk Goldgar, MS Access MVP www.datagnostics.com (please reply to the newsgroup) "BrianPaul" wrote: How could I modify the code below to go to the record if it was partial. For example: If I was looking for the name Brian or Bryan but wasnt sure, I could enter into the cboMoteTo "br" and it would navigate to the first record br. Thanks, any help would be greatly appreciated. Private Sub cboMoveTo_AfterUpdate() Dim rs As DAO.Recordset If Not IsNull(Me.cboMoveTo) Then 'Save before move. If Me.Dirty Then Me.Dirty = False End If 'Search in the clone set. Set rs = Me.RecordsetClone rs.FindFirst "[remarks] = """ & Me.cboMoveTo & """" If rs.NoMatch Then MsgBox "Not found: filtered?" Else 'Display the found record in the form. Me.Bookmark = rs.Bookmark End If Set rs = Nothing End If End Sub |
Thread Tools | |
Display Modes | |
|
|