How do I goto a specific Record in my Database?
- From: "Dooley007" <denbor@xxxxxxxxxxxx>
- Date: 2 Dec 2006 09:18:20 -0800
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
.
- Prev by Date: Re: txt-file is UTF8 or DOS.
- Next by Date: Greater than zero
- Previous by thread: Re: change PrintQuality to save ink
- Next by thread: Re: How do I goto a specific Record in my Database?
- Index(es):