M
MattE
I may be missing something easy, but I'm using a ComboBox to allow the
user to select a record. If the record's not there, they click a "New"
button. I want this button to add a new record and open another form
which allow them to edit the record.
I'm currently using the AutoNumbered record id in the OpenForm criteria
to determine which record to bind to the form:
Set ComboBox = Me.Controls("ComboMaterial") ' this value will be the
record id (AutoNumber)
Set rs = ComboBox.Recordset
' open the edit form using the AutoNumbered record id as the criteria
DoCmd.OpenForm "Material", , , "MaterialId = " & Str$(ComboBox.Value)
But if (before the OpenForm) I do rs.AddNew, then how do I bind the
edit form with the new record using the new AutoNumbered record id?
Am I on the right track? Hope this is clear, thanks!
user to select a record. If the record's not there, they click a "New"
button. I want this button to add a new record and open another form
which allow them to edit the record.
I'm currently using the AutoNumbered record id in the OpenForm criteria
to determine which record to bind to the form:
Set ComboBox = Me.Controls("ComboMaterial") ' this value will be the
record id (AutoNumber)
Set rs = ComboBox.Recordset
' open the edit form using the AutoNumbered record id as the criteria
DoCmd.OpenForm "Material", , , "MaterialId = " & Str$(ComboBox.Value)
But if (before the OpenForm) I do rs.AddNew, then how do I bind the
edit form with the new record using the new AutoNumbered record id?
Am I on the right track? Hope this is clear, thanks!