Open a Form to edit data

N

NDClark

I can make my data in the datasheet view a double-click to open a form.
However, I would like my form to open to the specific data that I am
double-clicking in order to edit it.

I know you can just click the data in the datasheet and edit. I want the
user to use the form to edit the data in the data sheet.

If you can offer any suggestions it would be greatly appreciated.
 
W

Wayne-I-M

Open the datasheet form in design view
Right click outside the details area (the grey section)
Select OnClick (of the form not the records)

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

Note - this
DoCmd.OpenForm "SomeFormName", acNormal, "",
"[ID]=[Forms]![DateSheetFormName]![ID]", , acNormal
is on one line

This will open SomeFormName at the record you have selected in the
datasheet. You may want to add a close event on the datasheet when you open
the SomeFormName like this


Private Sub Form_Click()
DoCmd.OpenForm "SomeFormName", acNormal, "",
"[ID]=[Forms]![DateSheetFormName]![ID]", , acNormal
DoCmd.Close acForm, "DataSheetFormName"
End Sub


Hope this helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top