How do I goto a specific Record in my Database?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have set up a program to keep track of Registrations fo a Lions
Convention using a Userform to collect the data (LName; 1stname; etc).
Everything works well and I can perform all functions required. The
Data will fill approx 1500 - 1600 lines starting from Row A1 to the end
of the data. The data is always expanding on a daily basis until max
registrations are received.

I have a requirement to occassionaly select a specific record to make
any changes that might be required after the fact. I have copied the
following code from a book "Visual Basic in easy Steps" by Tim
Anderson.

The code is as follows:

Private Sub cbSearch()

Dim Searchvar As String
Dim sBookmark As String


Sheets(1).Activate ' Select Registration Sheet


Searchvar = InputBox("enter the Lastname to find")
Searchvar = Trim$(Searchvar) ' removes surplus spaces

If Searchvar <> "" Then ' Cancel if nothing entered
With Sheet1.Recordset
.findfirst "Lastname like '" + Searchvar + "*'"
If .NoMatch Then ' RECORD NOT FOUND
MsgBox "No matching Record"
.bookmark = sBookmark
End If
End With
Eendif
End Sub

The compiler see,s to balk at "With Sheet1.Recordset" and points to
Recordset.

I have not done a huge amount of programing and this has me stumped.

Is the something I have done wrong or is there a easier way to
accomplish what I want to do>

Dooley

.


Quantcast