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
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
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