pa*************@yahoo.com wrote:
Thanks for any help - I have a form to enter records. It works fine. It
is crowded with over 30 fields. It has as its datasource a table (maybe
it should be a query of that table?). What I want to do is to take this
form, copy it, and turn it into a form for editing those records. I
would like to take my keyfield textbox for the record number (which is
an auto-number), and turn it into a combo box to bring up a list of the
records. Then upon finding the record, making data changes and saving
it. I just have ran into several errors trying to do this task.
Thanks! Bhavesh
Wouldn't it be better to have 1 form that can add/edit records?
You could have a combo box to find records.
You could use navigation buttons to go record to record and even to to a
new record. You could even put a button to go to a new record and use
something like
DoCmd.GoToRecord acDataForm, "FormName", acNewRec
In your combo have a list of all records.
In the forms OnCurrent event do something like
If Not Me.NewRecord Then
Me.ComboBox = Me.ID 'ID is assumed form's id field name
Else
Me.ComboBox = Null
Endif
In the ComboBox AfterUpdate event do something like
DIm rst As Recordset
Set rst = Me.Recordsetclone
rst.findfirst "ID = " & Me.ComboBox
Me.bookmark = rst.bookmark
rst.close
set rst = Nothing