Hi
I have combobox on form (Form1_withCombo),
1) Combo has record source from a Table1
2) Combo is bound to Table2, to add record there
3) Form1 which has combo, has button to add more records in combo (basically in Source Table1) via Form2 (for Adding record to Combo)
Problem
combo does not show value which I just added, unless I close current Form1 and reopen it. In that case record is fetched and appears in combo, works fine.
I tried to solve this, on close of a Form2 (adding record to combo)
Requery, RefreshRecord , every thing does not work.
Neither by RefreshRecord, nor by Requering Form1
Then I tried on close of Form (FormAddingComboData)
By this method of open record set, the new value appears in combo but when I select it, it disappears all of a sudden and never comes back unless I close and reopen form.
NOTE:
I dont want to open and reopen form, because my form has many data entry field. User has already filled data in the fields and then this will disappear.
My form has more than 3 such combos.
I have combobox on form (Form1_withCombo),
1) Combo has record source from a Table1
2) Combo is bound to Table2, to add record there
3) Form1 which has combo, has button to add more records in combo (basically in Source Table1) via Form2 (for Adding record to Combo)
Problem
combo does not show value which I just added, unless I close current Form1 and reopen it. In that case record is fetched and appears in combo, works fine.
I tried to solve this, on close of a Form2 (adding record to combo)
Code:
Forms![Form1_WithCombo].Form!cboComboName.Requery
Neither by RefreshRecord, nor by Requering Form1
Then I tried on close of Form (FormAddingComboData)
Code:
Dim cbo As ComboBox
Dim rs As DAO.Recordset
Set cbo = Forms![Form1_WithCombo].cboComboName
Set rs = CurrentDb.OpenRecordset(cbo.RowSource)
Set cbo.Recordset = rs
By this method of open record set, the new value appears in combo but when I select it, it disappears all of a sudden and never comes back unless I close and reopen form.
NOTE:
I dont want to open and reopen form, because my form has many data entry field. User has already filled data in the fields and then this will disappear.
My form has more than 3 such combos.