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

Tip: Looking for answers? Try searching our database.

A button alternative to double-clicking a subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jonefer - 28 Nov 2005 21:25 GMT
I have a subform viewed in datasheet display where a user can conveniently
view the details of that record in single-form view (pop-up) by
double-clicking
the subform.

However, some users prefer a button on the main form that they can
single click after selecting a record in the subform

The tricky part is getting the main form to recognize:
1) if anything has been selected in the subform
2) what has been selected

how can I get the following code to recognize the above 2 conditions?
DoCmd.OpenForm "frmDetails", acNormal, , "ID = " &
Form_sbfrm_Tasks_Interface.ID

Also tricky, is that if a routine is written in the 'Click' Event it will
interfere with the 'double-click' event.

I know I saw an example of this somewhere, but I can't seem to find it.
Graham Mandeno - 28 Nov 2005 21:53 GMT
Hi Jonefer

I assume you already have some code to handle the DblClick event(s) in the
subform.

I suggest you make it a Public function in the subform's module:

Public Function OpenDetailsForm()
DoCmd.OpenForm "frmDetails", acNormal, , "ID=" & ID, _
   WindowMode:=acDialog
End Function

Then, for the OnDblClick property of the form/controls, call the function:
   =OpenDetailsForm()

And then in the Click event procedure for the button on your main form, call
the subform's function:

Private Sub CmdShowDetails_Click()
Call Me!sbfrm_Tasks_Interface.OpenDetailsForm()
End Sub
Signature

Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

>I have a subform viewed in datasheet display where a user can conveniently
> view the details of that record in single-form view (pop-up) by
[quoted text clipped - 16 lines]
>
> I know I saw an example of this somewhere, but I can't seem to find it.
jonefer - 28 Nov 2005 23:02 GMT
Thanks, the clean up was nice too.

> Hi Jonefer
>
[quoted text clipped - 37 lines]
> >
> > I know I saw an example of this somewhere, but I can't seem to find 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.