SearchForRecord on Main form by doubleclicking record on non-linked Subform (1 Viewer)

GrandMasterTuck

In need of medication
Local time
Today, 00:56
Joined
May 4, 2013
Messages
129
Hi all. I thank you guys so much for always being willing to try and help with my ridiculously convoluted problems, and apologize in advance for the fact that this system is complicated in structure. Can't be helped at this stage. Anyway...

I have a form (frmFleet) with a tab control on it (FleetTabs), and on the tab control's first tab (MAIN) I have a subform (FleetBox).

The FleetBox subform control contains a form (sbfmFleet), and this form (sbfmFleet) has an embedded report called sbrptFleetList. sbfmFleet has tblFleet as its recordsource, which displays info on delivery vehicles we have. The sbrptFleetList contains a continuous list of all our vehicles, which the user can filter using some search boxes above where the report is embedded.

I want the user to be able to double-click a record on sbrptFleetList and have the system perform a SearchForRecord on sbfmFleet, but for some reason I can't get it to work. sbfmFleet has a combo box that does a SearchForRecord action, and that works perfectly. But when I try to perform the same kind of action by double-clicking a record on sbrptFleetList, it doesn't work.

What I have tried:

Matching exactly the SearchForRecord action of the combo box, and putting that on the double-click action of sbrptFleetList. The form just blinks but doesn't fetch the record.

Setting a SetTempVar action on the doubleclick of sbrptFleetList, then SelectObject frmFleet and GoToControl FleetBox (the control that contains sbfmFleet), then running a SearchForRecord action with ="[FleetAlias]='" & [TempVars]![FetchFleetAlias] & "'" ...the form blinks, nothing gets fetched

I tried referencing sbfmFleet instead of the control in which it resides, both with a direct GoToControl action and a series of actions where I use GoToControl FleetBox and THEN I do a SelectObject sbfmFleet, but I get an error about sbfmFleet not being open. The direct GoToControl action says it can't find the control I'm referencing (Forms!frmFleet!FleetBox.Form... and I even tried that without the ".Form" on the end)

I'm beginning to think I'm not referencing the correct control or path somewhere... are there any weird pitfalls or quirks I should be aware of when I try to do this? I'm sure I'm just doing something super-simple incorrectly and I don't realize it.

I know this sounds over complicated, and I wish I could easily provide a sample database for you to look at, but the dataset is really really big, and there are multiple forms and reports and whatnot in this system, not to mention the boss would hang me if he found me sharing his data with anyone.

I'm just hoping one of you has encountered an issue with trying to fetch a record on a subform by clicking a record in an embedded continuous report on that subform. The different ways to reference these controls is breaking my brain.

...Any ideas? One more poor illustration:

Code:
---------------------frmFleet-------------------------------------------------
|                                                                            |
|      --------------FleetTabs-----------------------------------------      |
|      |                                                              |      |
|      |        ---------FleetBox with sbfmFleet--------------        |      |
|      |        |                                            |        |      |
|      |        |  I want the record  ---sbrptFleetList----  |        |      |
|      |        |  to appear here     |                   |  |        |      |
|      |        |                     |     DbClick       |  |        |      |
|      |        |                     |     here          |  |        |      |
|      |        |                     |                   |  |        |      |
|      |        |                     ---------------------  |        |      |
|      |        |                                            |        |      |
|      |        ----------------------------------------------        |      |
|      |                                                              |      |
|      ----------------------------------------------------------------      |
|                                                                            |
------------------------------------------------------------------------------
 

Users who are viewing this thread

Top Bottom