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 / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

GoTo Record

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
wxchr - 13 Sep 2006 13:54 GMT
I have a form with Tab control.  One tab has a form in datasheet view,
based on a query called Open_Items.  When I double-click the
Date_Reported field, another tab appears, with the details of the
selected record.

The problem I'm having is I can't get the correct record to display.  I
have a primary key called cntlNum.

For example, on the datasheet view, I choose the second record in the
list, which has a cntlNum of 64, but a different record then I selected
appears on the new tab.

I was using the GoToRecord function and choosing CurrentRecord as the
offset.  This is where the problem lies.  In the example above, the
CurrentRecord is 2, because it's the second in the list on the
datasheet view.  The problem is the record is actually record 41 on the
main table.  Instead, I'm getting the 2nd record from the main table,
which has a different cntlNum.
Barry Gilbert - 13 Sep 2006 22:15 GMT
I don't think you can use GoToRecord here. You might be better off using
Recordset.FindFirst on the second form's recordset. You can pass criteria
into FindFirst to allow you to find the correct cntrlNum.

Air code:
Me.sfrmMySecondSubform.Form.Recordset.FindFirst "cntlNum = " & Me.cntlNum

Barry

> I have a form with Tab control.  One tab has a form in datasheet view,
> based on a query called Open_Items.  When I double-click the
[quoted text clipped - 14 lines]
> main table.  Instead, I'm getting the 2nd record from the main table,
> which has a different cntlNum.
 
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.