I have a continuous form, and I would like to programatically find and select one of the records with VBA if it meets certain conditions. How would I do this? Basically trying to control the record selector arrow with VBA.
I have a continuous form, and I would like to programatically find and select one of the records with VBA if it meets certain conditions. How would I do this? Basically trying to control the record selector arrow with VBA.
You could:
1. Use code to set the Filter and FilterOn properties of the subform
2. Use RecordsetClone and bookmarks to set focus to desired record. Example from my project:
Code:Public Sub tbxLabNum_AfterUpdate() Call ClearCustom Me.grpFilter = 1 Me.lbxQueries = Null Me.Requery With Me.ctrSampleList.Form.RecordsetClone .FindFirst "LabNum='" & Me.tbxLABNUM & "'" If .NoMatch = True Then MsgBox "Invalid Lab Number", , "EntryError" Me.tbxLABNUM.SelStart = 6 Else Me.ctrSampleList.Form.Bookmark = .Bookmark End If End With End Sub
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.