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 / November 2005

Tip: Looking for answers? Try searching our database.

custom search...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
webmaster@creativehawaiiangifts.com - 07 Nov 2005 19:53 GMT
I've built a custom search form that is used by many different forms in
our database. The search works fine. My problem is that I need to
change the current record of one form (the products form, the form that
opens the search form via command button) from the search form. The
search form finds one of our products based on user selection in a list
box (the primary key is what is returned). I desire to get the record
that was selected in the search form, based on the primary key that it
returns, and move the products form to the appropriate row. Im having a
hard time explaining this...Does anyone understand?
Albert D.Kallal - 08 Nov 2005 02:52 GMT
Just use the openform "where" clause.

docmd.OpenForm "frmProducts",,,"id = " & me!id

The above will open the frmProducts to the given "id" supplied.

Signature

Albert D. Kallal   (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal

webmaster@creativehawaiiangifts.com - 08 Nov 2005 19:22 GMT
Thanks that worked well. This method selects only one record from the
db, because Im searching a primary key. How do I go about getting all
the records but focused on the searched record?

Thanks.
Albert D.Kallal - 09 Nov 2005 00:00 GMT
> Thanks that worked well. This method selects only one record from the
> db, because Im searching a primary key. How do I go about getting all
> the records but focused on the searched record?

To accomplish what you want, we will now NOT restrict the records loaded,
but "move" the forms pointer to the record we want.

We can use:
docmd.Openform "frmProducts"
forms!frmProducts.RecordSet.FindFirst "id = " & me.id

I as a general rule remove navigation buttions, and load the form to ONE
record (no need to load up more data then the user needs).
However, the above should do the trick for you...

Signature

Albert D. Kallal   (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal

 
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



©2009 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.