Solved

Update data on form based on subform

Posted on 2008-10-31
5
439 Views
Last Modified: 2013-11-28
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
Comment
Question by:kshumway
  • 3
  • 2
5 Comments
 
LVL 10

Accepted Solution

by:
LennyGray earned 500 total points
ID: 22853264
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
 
LVL 10

Expert Comment

by:LennyGray
ID: 22853274
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
 

Author Comment

by:kshumway
ID: 22853286
Thank you.  I'll try that out!
0
 

Author Comment

by:kshumway
ID: 22854731
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
 
LVL 10

Expert Comment

by:LennyGray
ID: 22854867
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now