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 / Forms Programming / June 2007

Tip: Looking for answers? Try searching our database.

Records show from searching by combo box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chinny03 - 05 Jun 2007 14:21 GMT
I have my primary key as a combo box where you can search for the correct
key.  When the user finds the correct key how would I have the rest of the
data show up below it?
Klatuu - 05 Jun 2007 16:20 GMT
Use the combo's After Update event.

Private Sub MyCombo_AfterUpdate()
Dim rst As Recordset

   Set rst = Me.RecordsetClone
   With rst
       .FindFirst "[PrimaryKeyField] = " & Me.MyCombo
       If Not .NoMatch Then
           Me.Bookmark = .BookMark
       End If
   End With
End Sub

[PriemaryKeyField] should be the name of the field in the form's recordset
that is the primary key.

The above also assumes that key is a numeric field.  If it is not, you will
need to use the correct delimiters for the field's data type.
Signature

Dave Hargis, Microsoft Access MVP

> I have my primary key as a combo box where you can search for the correct
> key.  When the user finds the correct key how would I have the rest of the
> data show up below it?
 
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



©2008 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.