Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2007

Tip: Looking for answers? Try searching our database.

OpenArg with subform criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Will G - 20 Mar 2007 23:18 GMT
i have a question if anyone can answer.

i have a form(Main) and has a sub form(subMain) and it's in a datasheet
format. i like to click on one of the fields record in the datasheet, say
field: Name and record: John, and this click action will open another
form(frmPerson) that should have "John" in the name field and others
specifications for that peson.

i have and click event under field Name of the subform (subMain) and i guess
i have to set some criteria to the docmd.OpenForm "frmPerson",,,,, to
populate what i want in that form, but i am confused on how to do this. CAN
ANYONE HELP? THANKS.
Signature

need help

Albert D. Kallal - 20 Mar 2007 23:45 GMT
You don't need open args..

Assuming we are in the sub-form, and we want to launch a form that is set to
the SAME record, just go:

me.Refresh
docmd.OpenForm "frmMoreDetails",,,"id = " & me!id

You can remove the me.refresh command if you don't allow editing in the
sub-form.

The openform command simply tells ms-access to open a form, and the "where"
clause sets the forms record to the same one we are viewing in the sub-form
(it is assumed that the record has a key field called id).

Signature

Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.