Re: How to show changes in open Access 2003 Table in VB
I have a form to add a new record to my Access Database table.
This is a code:
All works OK.
The only problem I have: If the table "Food Details" is open in other window in Datasheet view, no changes are visible.
Obviously, I should add some line to the code, but I don't know what it should be.
How to refresh the table's datasheet view programmaticall y in VB?
I have a form to add a new record to my Access Database table.
This is a code:
Code:
Private Sub btnAdd_Click() Dim dbExpenses As DAO.Database Set dbExpenses = CurrentDb ................................ 'To Get the RecordID 'Add new record Dim rstFDet As DAO.Recordset Set rstFDet = dbExpenses.OpenRecordset("Food Details", dbOpenDynaset) rstFDet.AddNew rstFDet("Food Category ID").Value = Forms!AddFoodDetRecord!lstFCat rstFDet("Food Category Name").Value = Forms!AddFoodDetRecord!lstCatName rstFDet("Shop Name").Value = Forms!AddFoodDetRecord!cmbShop rstFDet("Date").Value = Forms!AddFoodDetRecord!tbDate rstFDet("Type").Value = Forms!AddFoodDetRecord!cmbType rstFDet("Name").Value = Forms!AddFoodDetRecord!cmbName rstFDet("Quantity").Value = Forms!AddFoodDetRecord!tbQuant rstFDet("Coupons").Value = Forms!AddFoodDetRecord!tbCoupons rstFDet("Sale Savings").Value = Forms!AddFoodDetRecord![tbSavings] rstFDet("Amount").Value = Forms!AddFoodDetRecord!tbAmount rstFDet.Update rstFDet.Close ....................................................... 'Enable Undo action Me!btnUndoAdd.Enabled = True End Sub
The only problem I have: If the table "Food Details" is open in other window in Datasheet view, no changes are visible.
Obviously, I should add some line to the code, but I don't know what it should be.
How to refresh the table's datasheet view programmaticall y in VB?
Comment