Full Version: Simple Qu - Referencing A Field In A Sub Form When Opening Main Form
UtterAccess Forums > Microsoft® Access > Access Forms
Hi All,

Newbie and beginner to Access here. I have been working on creating my own database and have made plenty of progress using the forum and also teaching myself via youtube tutorials.
This one has me stumped and I can not find a clear answer on this. I am afraid it may be quite simple.

I have a continuous form that displays Boat Names, I would like to click on the BoatID and be taken to another form to the specific BoatID record. My problem is that the BoatID is in a subform.

A few extra details -

Initial form = F_BoatInventory
with the field [BoatID] (which I want to double click on to take me to the below)

Second Form to automatically open = F_BoatOperators
with a Subform within = F_SubBoatInventory
which contains the [BoatID] that I want to go to.

How do I do this? I have used a macro to go from one form (Dbl Click) to another successfully but its the fact that the referenced field is in the subform that I am getting stuck on.

Can anyone assist? Thanks in advance.

You are clicking on BoatID in the subform? You want to open a standalone form? This should be simple. I don't use macros, only VBA. Code behind the subform, assuming BoatID is a number type:

DoCmd.OpenForm "F_BoatOperators", , , "BoatID=" & Me!BoatID
The opposite way around.

I have a form(A) that I want to double click the field (BoatID) on which needs to take me to a second form (B) that contains a subform (B2). The subform (B2) has the field (BoatID) that needs to equal the field (BoatID) on the first form (A) that I want to double click on.
Then you probably need to apply filter criteria or some GoTo code.

If you want to provide db for analysis, follow instructions at bottom of my post.

Or maybe a reference in the subform's data source. Why a subform? What is on subform B (main form)? Is it bound? Could you just do away with the main form?
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.