Good afternoon all,
I have added a listbox to one of my "edit" forms and I have set the rowsource in the form_current code section to retrieve data from a table based on the value in a form field
List174.RowSource = "SELECT tblCodesAddEdit.Auto, tblCodesAddEdit.[IOE Code], tblCodesAddEdit.[Uptix Code], tblCodesAddEdit.MMDBID FROM tblCodesAddEdit WHERE (((tblCodesAddEdit.MMDBID)=[forms]![frmAddEdit]![mmdbid]))"
This works fine if I open the form directly and I can see all of the record data including the list box
My problem with it is one of the processes in the application is to call the edit form from the main form after a series of append queries to varoius tables are run and the edit form is opened. On opening of the edit form another query is run to go directly to the record that is required to edit.
All fields update fine, but the list box does not. I have created a button and tried various coding me.refresh, setting the listbox.rowsource again, yet the listbox does not update.
If I close the edit form and open it directly, the listbox is populated with the correct data.
I have attached the code behind the edit button on the main form which calls all queries. I have also included the SQL of the Query that finds the recordset on the edit form.
If you can help it would be much appreciated.
Many thanks
Larry
I have added a listbox to one of my "edit" forms and I have set the rowsource in the form_current code section to retrieve data from a table based on the value in a form field
List174.RowSource = "SELECT tblCodesAddEdit.Auto, tblCodesAddEdit.[IOE Code], tblCodesAddEdit.[Uptix Code], tblCodesAddEdit.MMDBID FROM tblCodesAddEdit WHERE (((tblCodesAddEdit.MMDBID)=[forms]![frmAddEdit]![mmdbid]))"
This works fine if I open the form directly and I can see all of the record data including the list box
My problem with it is one of the processes in the application is to call the edit form from the main form after a series of append queries to varoius tables are run and the edit form is opened. On opening of the edit form another query is run to go directly to the record that is required to edit.
All fields update fine, but the list box does not. I have created a button and tried various coding me.refresh, setting the listbox.rowsource again, yet the listbox does not update.
If I close the edit form and open it directly, the listbox is populated with the correct data.
I have attached the code behind the edit button on the main form which calls all queries. I have also included the SQL of the Query that finds the recordset on the edit form.
If you can help it would be much appreciated.
Many thanks
Larry