Hello,
I have a data-table. Using a search-form (FrmSearch) I populate data in a listbox (in the search-form). When a user double clicks a row in the listbox a new form (FrmEditNewRecord) is opened to edit the row.
On the search-form is also a button where a new record can be created. Basically this is the same form (FrmEditNewRecord) as the edit form except the control source is different.
The only problem is when I want to make a new record the following line of code has to be included in the Form_open of the FrmEditNewRecord :
the only problem is I only want to do this when the button "new record" is clicked and not when the listbox is double clicked (for editing a record).
Placing the code under the BtnNewRecord_click in the FrmSearch does not work.
Whats the solution?
Thanks in advance.
I have a data-table. Using a search-form (FrmSearch) I populate data in a listbox (in the search-form). When a user double clicks a row in the listbox a new form (FrmEditNewRecord) is opened to edit the row.
On the search-form is also a button where a new record can be created. Basically this is the same form (FrmEditNewRecord) as the edit form except the control source is different.
The only problem is when I want to make a new record the following line of code has to be included in the Form_open of the FrmEditNewRecord :
Code:
DoCmd.GoToRecord , , acNewRec ' This created a new record.
the only problem is I only want to do this when the button "new record" is clicked and not when the listbox is double clicked (for editing a record).
Placing the code under the BtnNewRecord_click in the FrmSearch does not work.
Whats the solution?
Thanks in advance.