UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Simple Qu - Referencing A Field In A Sub Form When Opening Main Form, Access 2016    
 
   
arandell
post Jan 10 2019, 11:49 PM
Post#1



Posts: 2
Joined: 10-January 19



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.

Go to the top of the page
 
June7
post Jan 11 2019, 12:57 AM
Post#2



Posts: 227
Joined: 25-January 16



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
This post has been edited by June7: Jan 11 2019, 12:57 AM

--------------------
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.
Go to the top of the page
 
arandell
post Jan 11 2019, 02:21 AM
Post#3



Posts: 2
Joined: 10-January 19



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.
Go to the top of the page
 
June7
post Jan 11 2019, 05:06 AM
Post#4



Posts: 227
Joined: 25-January 16



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.





--------------------
To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression. Attachment Manager is below Advanced editor window, click Go Advanced below Quick Reply window.
Go to the top of the page
 
projecttoday
post Jan 11 2019, 11:33 AM
Post#5


UtterAccess VIP
Posts: 10,534
Joined: 10-February 04
From: South Charleston, WV


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?

--------------------
Robert Crouser
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    22nd January 2019 - 09:52 AM