Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a form linked to the active record in a datasheet 1

Status
Not open for further replies.

ViAn

Technical User
May 7, 2003
30
NO
Hello!

I want to open a form (MyForm2) showing a record where MyID2 corresponds to MyID1 of the active/marked record in a datasheet.

The datasheet is placed as a subform on a form (MyForm1) on which I want to add a command button that opens MyForm2. The datasheet uses "MyDirectQuery" as source.

(I know how to do this using a list instead of a datasheet, but I have a good reason for using a datasheet).

Is it f ex possible to refer to the navigation field of the datasheet (which is a subform on the actual form)?

Y.S.
-ViAn-
 
Hi ViAn,

Assuming you are putting this behind a button on the Main Form or somewhere similar, to use a value from the active record in a subform (whether datasheet or not) use ..

Code:
Me!Controls!
Code:
SubFormControlName
Code:
.Form!
Code:
NameOfColumnInSubForm
Code:

.. replacing the bits in red with your own names.

Enjoy,
Tony
 
In my case it seems like I have to omit the letters "Controls!". After having done that, everything works like I want to.

A star to you, Tony!

-ViAn-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top