How to design this form edit record scenerio?

  • Thread starter Cheng-Liang Shen
  • Start date
C

Cheng-Liang Shen

Hi All

I would like design a Main Form listing all the records in the table, then
then I can select one of the record and
hit Edit button to open another Edit Form to modify each record field with
the data lock protection. Then hit the
Save button to close the Edit Form and go back to Main Form. Could anyone
give me the direction how this could
be done in Microsoft Access? Appreciate the help.
 
A

Allen Browne

Assuming your main form has a primay key named (say) "ID", you can use that
value in the WhereCondition of the OpenForm action to open another form for
editing:

Private Sub cmdEdit_Click()
If Me.NewRecord Then
Beep
Else
DoCmd.OpenForm "MyEditForm", WhereCondition:="[ID] = " & Me.[ID],
WindowMode:=acDialog
End If
End Sub
 

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