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

Tip: Looking for answers? Try searching our database.

Switch to another Form at the same record by Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony WONG - 26 Oct 2005 04:18 GMT
there is a button to switch (openform) to another interface.

how can i stay at the same record after jump into another interface

in other words, record #53 is stayed at the main screen.

after jump into another sub-screen, how can instruct Access to jump to
record #53?

Thanks a lot.

Tony
Pat Hartman(MVP) - 26 Oct 2005 06:18 GMT
Use the Where Condition of the OpenForm Action.  Relational databases don't
have the concept of record #.  You "find" a record by using its primary key.

> there is a button to switch (openform) to another interface.
>
[quoted text clipped - 8 lines]
>
> Tony
Rich Wills - 26 Oct 2005 09:44 GMT
Hi Tony

Here's a little code for you to use hope it is usefull let me know how you
get on

'To Open FORM2 from FORM1 (current form) where the field is TEXT format
   DoCmd.OpenForm "FORM2", , , "[TEXTfield]='" & Forms!FORM1!
YourCurrentField & "'"
   
'To Open FORM2 from FORM1 (current form) where the field is NUMBER /
AUTONUMBER format
   DoCmd.OpenForm "FORM2", , , "[NUMBERfield]=" & Forms!FORM1!
YourCurrentField

'If you want to do a check to make sure this has gone to the right record use
' the following. I have put a procedure that if it is the wrong record
' then it will close FORM2 and display a message box but I hope you get the
' idea of how it works

' After the 'Docmd.Openform....

If Forms!FORM2!TEXTfield = Forms!FORM1!YourCurrentField Then
   Forms!FORM2.SetFocus
'or
   Forms!FORM2!ANOTHERfield.SetFocus
Else
   DoCmd.Close acForm, "FORM2"
   MsgBox "The Record Couldn't Be Found", vbCritical, "Error Occured"
End If

Rich

>there is a button to switch (openform) to another interface.
>
[quoted text clipped - 8 lines]
>
>Tony
Tony WONG - 27 Oct 2005 04:11 GMT
Thanks a lot.

It works now.

"Rich Wills via AccessMonster.com" <u15180@uwe> ¼¶¼g©ó¶l¥ó·s»D:56683a8075a2c@uwe...
> Hi Tony
>
[quoted text clipped - 42 lines]
>>
>>Tony
Rich - 31 Oct 2005 12:12 GMT
Cool

Anything else just ask!

Rich

>Thanks a lot.
>
[quoted text clipped - 6 lines]
>>>
>>>Tony
 
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.