Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

Update data on form based on subform

I am completing an in-house developed Access system which will be used as our Courier Dispatch Ticket system.  The Main form allows the user to input the information about a call.  There is a continuous subform that updates based on a timer that displays the dispatch tickets entered for the cureent day.  The records on the subform are color coded based on criteria in the record.  For example, records that have been assigned are green.  If there is no courier assigned, the record is blue.  If the courier has completed the delivery, the record is white.  As information is entered on the Main form, the subform is updated appropriately.  This is working fine.  
Now the manager of the Couriers would like to be able to click on an entry on the subform and have the data associated with that record displayed on the main form.  Is there a way to do this?    I've attached a screen shot of the form to help better explain what is desired.
Update-main-form-based-on-subfor.doc
0
kshumway
Asked:
kshumway
  • 3
  • 2
1 Solution
 
LennyGrayCommented:
When the user double-clicks (use double-click so that it is an intentional user command) on a data control (it must be enabled) on the subform, the OnDoubleClick event would fire and call the "Look Up Ticket by..." OnClick Function in the main form.

The main form command button private function would have to changed to a public function. Then you would call the main form function by coding:

Forms("Form1").TheAppropriateLookupCommandButton_OnClick

Good Luck !!
Lenny Gray
0
 
LennyGrayCommented:
Of course, you would have to pass the index of the record in the subform to the main form so that the OnClick would look for the correct data.
0
 
kshumwayAuthor Commented:
Thank you.  I'll try that out!
0
 
kshumwayAuthor Commented:
I am having a problem with the syntax to invoke the onClick event of the button on the parent form.  This is an Access 2003 application.
0
 
LennyGrayCommented:
try:

Call Forms("Form1").TheAppropriateLookupCommandButton_OnClick()

If it does not work send me the mdb and I'll make it work for you.

Lenny
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now