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 / August 2005

Tip: Looking for answers? Try searching our database.

Find or filter a Record in Main Form from Subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andi Lee Davis - 02 Aug 2005 10:09 GMT
Hi,

Any Help most Gratefully Appreciated.

I have looked up the forms but nothing seems to really answer my question
just right and its very simple.

I have a Database which plots stories and plays into sections. I have a form
which is labelled SectionSheet which also has continuous subform named
SectionSheetMap. This Map is based on a query from the Main Table
SectionSheet.
The subform filters the list of all the sections to those with the main
character on the main form as a sort of overview. You can see which section
sheet is the characters next and pre section. So the Form and Subform are
linked by the section Character - Not the SectionNo which is the Primary Key.

What I would like to do is two things.

1) Highlight the font or make it bold on The SectionNo field in the Subform
and move to the recordset along the continuous form to match the record you
are on in the main form. - Haven't started working on this yet.

2) This is the bit I have been working on. On Double Click of a SectionNo of
the subform - Jump to that section in the main form. I have got so far and
managed to get the focus back to the SectionNo in the main form but it keeps
filtering the Subform to match the SectionNo in the Main form.

Here is the code I have already: (I used a filter to try it first)

Private Sub SectionNo_DblClick(Cancel As Integer)

Dim MapNo As String
 
MapNo = Form_SectionSheetMap.SectionNo

On Error GoTo clickError

Me.Filter = " [Forms]![SectionSheet]![SectionNo] like " & MapNo & ""
Forms!SectionSheet!SectionNo.SetFocus
Me.FilterOn = True

clickError:

Resume Next

 
End Sub

Thanks

Andi
Andi Lee Davis - 03 Aug 2005 09:16 GMT
Ok so I solved it now with this...

Private Sub SectionNo_DblClick(Cancel As Integer)
Dim MapNo As String
 MapNo = Form_SectionSheetMap.SectionNo
 On Error GoTo clickError
 Forms!SectionSheet!SectionNo.SetFocus
DoCmd.GoToRecord acActiveDataObject, , acFirst, no
DoCmd.FindRecord MapNo, acEntire, no, acSearchAll, no, acCurrent, no

clickError:
Resume Next

End Sub

This works a treat for wanting to jump to the record in the main form from a
subform.

All I need to know how to do now is point 2.

Move the current record in the subform  (Continuous form) along with the
main form so that it scrolls along keeping the record in the subform in view.
I do not want it fixed to the main form (IE you can still scroll up and down
independantly using the scroll bar) Also highlighting on making the font in
the PK show so you see the matching reocrds quickly.

Any help appreciated.

Thanks

Andi

> Hi,
>
[quoted text clipped - 47 lines]
>
> Andi
 
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.