Extremebfn
10-21-2004, 12:40 AM
Ok. One of my main problems was that if i delete a record from a Datagrid by using the mouse to select it and then pressing the delete key, i got a error.This was fixed by adding a Primary Key to my table which was connected to the datagrid.
Now my next problem: The program is a Quotation program. So here is how the program works.
1. The user selects a product from a Combo box and clicks on a ADD Buton.
2. The selected product is added to a Table(QuoteDetailSection).
3. The Datagrid is set to that Table,so after the add i use a Datagrid.Refresh to display the newly added records to the Table inside the datagrid.
4. The Totals and Tax amount is displayed inside a Textbox just below the Datagrid. This values are updated when the tables containts change.
Ok...so the obove steps work 100%. But what about the Delete? I client want to be able to remove a item from the quote.Ok...so this is done my using the mouse to select the Row in the datagrid..and pressing the delete key. Cool...so this works...but NOW! My problem is to update the new Totals and Tax values.
I placed my function that Calcualates the new Values in the AfterDelete Funtion of the Datagrid...but then i still shows the amount without deducting the deleted item. So what i did i ran the program in debug mode(F8) and when steps by step.When it gets to the AfterDelete Funtion and calls the CalculateNewTotals Function, i went into my database(Access) and the Deleted item was still their.It only gets deleted after the AfterDelete funtion...so it kinda deletes SLOW? what can this be??
Now my next problem: The program is a Quotation program. So here is how the program works.
1. The user selects a product from a Combo box and clicks on a ADD Buton.
2. The selected product is added to a Table(QuoteDetailSection).
3. The Datagrid is set to that Table,so after the add i use a Datagrid.Refresh to display the newly added records to the Table inside the datagrid.
4. The Totals and Tax amount is displayed inside a Textbox just below the Datagrid. This values are updated when the tables containts change.
Ok...so the obove steps work 100%. But what about the Delete? I client want to be able to remove a item from the quote.Ok...so this is done my using the mouse to select the Row in the datagrid..and pressing the delete key. Cool...so this works...but NOW! My problem is to update the new Totals and Tax values.
I placed my function that Calcualates the new Values in the AfterDelete Funtion of the Datagrid...but then i still shows the amount without deducting the deleted item. So what i did i ran the program in debug mode(F8) and when steps by step.When it gets to the AfterDelete Funtion and calls the CalculateNewTotals Function, i went into my database(Access) and the Deleted item was still their.It only gets deleted after the AfterDelete funtion...so it kinda deletes SLOW? what can this be??