Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / July 2007

Tip: Looking for answers? Try searching our database.

scrolling to a field in a continuous form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maury Markowitz - 18 Jul 2007 15:26 GMT
I have a large continuous form filled with a bunch of fields containing text.
The user would like to be able to type in the contents of one of the fields
and have the form scroll to that point.

My first attempt was to put an unbound field at the top, when you type into
it is loops over the form using SelTop to see if it can find it.

Is there an easier way?

Maury
John W. Vinson - 26 Jul 2007 18:20 GMT
>I have a large continuous form filled with a bunch of fields containing text.
>The user would like to be able to type in the contents of one of the fields
[quoted text clipped - 6 lines]
>
>Maury

One would be to have a Combo Box to *select* the value of the field, and
filter the form to show just that record.

Or, you can use code like this in the control's AfterUpdate event:

Private Sub controlname_AfterUpdate()
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[fieldname] = '" & Me.controlname & "'"  <<< text fields
- or -
rs.FindFirst "[fieldname] = " & Me.controlname   <<< numeric fields
- or -
rs.FindFirst "[fieldname] = #" & Format(Me.controlname, "mm/dd/yyyy") & "#"
                 <<< date fields
If rs.NoMatch Then
  MsgBox "No such record found!"
Else
  Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End Sub

            John W. Vinson [MVP]
Maury Markowitz - 27 Jul 2007 15:44 GMT
>    Me.Bookmark = rs.Bookmark

Ah ha! I think this is the key I was looking for.

I did go ahead and implement it "the hard way" anyway, and it actually works
fine as long as you turn off echo.

Maury
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.