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 / March 2007

Tip: Looking for answers? Try searching our database.

Getting a value from a subform contained in a tab control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LarryP - 12 Mar 2007 19:11 GMT
SITUATION:

My main form has...
 a Tab Control that has...
   subform1 in tab 1 (and other subforms in other tabs).
       subform1 displays continuous records:
           Value1      Value2
           Value1      Value2
           etc.

Whenever Value2 is double-clicked in any record, I need to capture value1
for that record and store it in a global variable.  Have tried various ways
of referring to Control1 (the control that contains Value1), but have either
gotten various "can't find it" errors or have gotten the Control1 value for
the FIRST record displayed in subform1, no matter which record the
doubleclick happened in.  Help, help, help.
ruralguy - 12 Mar 2007 19:35 GMT
Are you putting code in the DoubleClick event of the Value2 control in the
SubForm?  Where is the Global variable defined?  What code have you tried?

>SITUATION:
>
[quoted text clipped - 12 lines]
>the FIRST record displayed in subform1, no matter which record the
>doubleclick happened in.  Help, help, help.

Signature

HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

LarryP - 12 Mar 2007 19:47 GMT
Yes, the doubleclick module causes some things to happen, and what I now want
to happen FIRST is that it captures the value I described from the subform
and puts it in the global variable.  

The global variable is defined in a separate "Globals" module so it's
accessible from anywhere, not just from the subform-associated code.

I've experimented with several different variations of the
Forms!MainForm!subForm1.Forms.Controls "name-ology," adding or taking out
various pieces to try to find the right object string, but haven't hit on the
right one yet.  As I said, the closest I've come does indeed capture a value
and place it into the global variable, but it's Value1 from the FIRST record
in the subform, not from the record where the double-click action happened.

> Are you putting code in the DoubleClick event of the Value2 control in the
> SubForm?  Where is the Global variable defined?  What code have you tried?
[quoted text clipped - 15 lines]
> >the FIRST record displayed in subform1, no matter which record the
> >doubleclick happened in.  Help, help, help.
ruralguy - 12 Mar 2007 19:59 GMT
When you click or doubleclick in a field in a continuous form, that record
becomes the Current Record for the form.  If the code is in the DoubleClick
event of the control for Value2 then I would thing that GlobalVariableName =
Me.Value1ControlName would do it.  Using your names of course!

>Yes, the doubleclick module causes some things to happen, and what I now want
>to happen FIRST is that it captures the value I described from the subform
[quoted text clipped - 15 lines]
>> >the FIRST record displayed in subform1, no matter which record the
>> >doubleclick happened in.  Help, help, help.

Signature

HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

 
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.