button to open another form with same record

  • Thread starter Thread starter jiji
  • Start date Start date
J

jiji

hi
I am trying hardly to set a button which will open anther form with the same
record. I tried macros but it did not work. any help pls.
thanks
jiji
 
The code behind the button will need to be


me.Refresh ' must force a disk write of record so the other form
' can load it..

docmd.openForm "yourFormName",,,"id = " & me!id

The above assume you have a primary key in the table called id...
 
The button wizard includes a selection to open another form. When you
select that option, it will offer you the option to open it to a particular
record and it will let you select the field to use.

Use the button wizard and it will walk you right through this.
 
jiji said:
hi
I am trying hardly to set a button which will open anther form with
the same record. I tried macros but it did not work. any help pls.
thanks
jiji

One of the options within the Command Button wizard will do this for you.
Just make sure that the Toolbox wizard is enabled (Magic wand toggle on the
bar) and then drop a new button onto your form. From the wizard you want...

Form Operations - Open Form
Choose form to open
(*) Open the form and find specific data to display
Select the Primary key as the matching data field(s)
 
my problem is for ex: if i have the form member opened on a specific member
no 123 , i would like to be able to click on a button that will take me
right away to another info form related to this member. mu button works to
open the form but not at the same record. thanks
 
Again, the wizard includes an option to do this. Remove your button and add
a new one using the wizard. It will do the code for you.
 
Also, in the post below, the code does what you ask...

....yourFormName",,,"id = " & me!id


You would have to replace that with your field names. That section of code
is the part that makes sure the correct record is opened.
 
Back
Top