HELP! Please!!! Click data and open a form to edit that same data.

N

NDClark

I have a macro set to open another form (The Edit Form) to edit data found on
the original Multiple Item Form.

The problem is the (The Edit Form) always opens to the very
first record or a new record.

I need the form to open the record I click on, so I can edit that record.

Can someone give me some suggestions as to what I am doing wrong?
 
W

Wayne-I-M

It depends what type of form your are clicking the date on

eg. In a datasheet you put the command on the OnClick of the Form. On other
forms you put the command of the OnCllick of a control (normally), etc

eg. (datasheet)

Private Sub Form_Click()
DoCmd.OpenForm "FormToOpen", acNormal, "",
"[ID]=[Forms]![DataSheetName]![ID]", , acNormal
End Sub
 
W

Wayne-I-M

Sorry - I have just re-read you post (you are using a macro). I don't use
many macros - so...

Try this
Open your Macro in Design View
Select Open Form
Use the build option (in the box at the bottom)
Add the ID field on the form 1
Add the name (form name and control name) of form 2

So it will look something like this

[ID]=[Forms]![Form2Name]![ID]
 
N

NDClark

Thank you Wayne! You have helped me. I was pulling my hair out with this.

Wayne-I-M said:
It depends what type of form your are clicking the date on

eg. In a datasheet you put the command on the OnClick of the Form. On other
forms you put the command of the OnCllick of a control (normally), etc

eg. (datasheet)

Private Sub Form_Click()
DoCmd.OpenForm "FormToOpen", acNormal, "",
"[ID]=[Forms]![DataSheetName]![ID]", , acNormal
End Sub




--
Wayne
Manchester, England.



NDClark said:
I have a macro set to open another form (The Edit Form) to edit data found on
the original Multiple Item Form.

The problem is the (The Edit Form) always opens to the very
first record or a new record.

I need the form to open the record I click on, so I can edit that record.

Can someone give me some suggestions as to what I am doing wrong?
 
Top