Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default How do I goto a specific Record in my Database?

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default How do I goto a specific Record in my Database?

Try substituting "UsedRange" for "Recordset" and see if it still balks.
Recordset normally applies to Pivot Tables or Query Tables.

"Dooley007" wrote:

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How do I goto a specific Record in my Database?

Since usedrange doesn't have a FindFirst Method or NoMatch or BookMark
properties, it may be more complex than that.

Perhaps you could eleborate.

--
Regards,
Tom Ogilvy



"JLGWhiz" wrote in message
...
Try substituting "UsedRange" for "Recordset" and see if it still balks.
Recordset normally applies to Pivot Tables or Query Tables.

"Dooley007" wrote:

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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to goto specific cell (todays date) crimekilla Excel Discussion (Misc queries) 4 May 11th 10 04:42 PM
Goto a specific cell in a macro Edward Excel Discussion (Misc queries) 0 July 16th 07 08:24 PM
Database Record add Oldjay Excel Discussion (Misc queries) 1 October 13th 06 02:07 AM
Locate/goto a specific worksheet quickly johanc Excel Worksheet Functions 4 July 7th 06 04:18 PM
Goto Specific Textbox in Userform Kris_Wright_77[_2_] Excel Programming 3 August 10th 05 03:23 PM


All times are GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"