Link to home
Start Free TrialLog in
Avatar of TimothyHughes
TimothyHughes

asked on

Open form from clicking field in query (when query is in a subform)

I have a subform on my form which displays a query as the source object. I did this to accomodate the dynamic nature of the fields within the query (it's a crosstab query which has different numbers of columns based upon the results the user is after).

I want to have the user double click a field on the subform query (an order number) and have another form open (trigger an event).
Is this possible?

Thanks in advance.
SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TimothyHughes
TimothyHughes

ASKER

Thanks Jeff for the feedback. I am technically proficient with VBA coding and SQL, so any level of specifics of a solution will be helpful.

The top part of the form is a query builder which allows the user to refine the financial information provided in the subform. I have a crosstab query which shows the financial information by month (which can be decreased by the query filters) with fields at the beginning stating customer/salesrep/etc.  

I want the user to be able to click on a field and have a new form initiate which shows details for that row (a list of invoices, etc.). As LSMConsulting pointed out, I do not have an event model exposed with the query subform.

I was thinking of 3 possible solutions:
1) Dynamically create a data sheet form and find a way to dynamically add the event into it. I understand that this can cause problems with compiling and exposes you to possible corruption (from what i have read).
2) Use a 'Hyperlink' type of solution which points to a form. I do not know if something exists like this though.
3) Have the user highlight the order number and then press a function key. I would then write some code to post the order number to the clipboard, then open a form with the information I have in the clipboard.

Your idea of a listbox is a great one. Thanks!
I am researching it right now to see if it can work for what I am after. Let me see if I can get that many columns to view nicely as a list.

<so any level of specifics of a solution will be helpful. >
As I stated, you have not provided any details on the design or purpose of the form.
We are also lacking the details of the crosstab subform (Linking fields, ...etc) or how (or if) it filters.
So a more "specific solution may be hard to come by here.

But my post outlines the basics of one possible solution.

Perhaps if you posted a sample of your database, this would all be clearer.

Sample database notes:
1. Back up your database(s).
2. Combine the front and back ends into one database file.
3. Remove any startup options, unless they are relevant to the issue.
4. Remove any records unless they are relevant to the issue.
5. Delete any objects that do not relate directly to the issue.
6. Remove any references to any "linked" files (files outside of the database, Images, OLE Files, ...etc)
7. Remove any references to any third party Active-x Controls (unless they are relevant to the issue)
8. Remove, obfuscate, encrypt, or otherwise disguise, any sensitive data.
9. Compile the code. (From the VBA code window, click: Debug-->Compile)
10. Run the compact/Repair utility.
11. Remove any Passwords and/or security.
12. If a form is involved in the issue, set the Modal and Popup properties to: No
    (Again, unless these properties are associated with the issue)
13. Post the explicit steps to replicate the issue.
14. Test the database before posting.

In other words, ...post a database that we can easily open and immediately see and/or troubleshoot the issue.
And if applicable, also include a clear graphical representation of the *Exact* results you are expecting, based on the sample data.


JeffCoachman

I had thought I was asking a generic question which I now believe has no solution.

JeffCoachman did not like my question which I thought was detailed enough and succinct.

I have since completed a work-around and would like to thank the experts for their efforts.
TimothyHughes,

I never said I did not like your question...

I only said that I could only post a general solution, because I knew so little about your existing design.

If you post a sample, and provide the needed explanations, ...I would be more than willing to assist you further.

JeffCoachman
What was the workaround?