Hello,
I am just a self-teached beginning access user, so every usefull comment is welcome.
I have a form that retrieves some parameters X1, ..., Xm (X all together) and a multiplier Y from a database. Then it computes at several points Z1, ..., Zn function values f(X,Y,Zi) and stores them in a table. From this table a XY-graph is constructed and displayed in the form.
In a combo box the user can override the multiplier Y by entering a new multiplier Y. Via vba code, the table with the function values is emptied and filled with the new function values (and points Z offcourse).
There are two problems:
1. When the vba code that recomputes the table is triggered by the "On Change" event of the combo box, the vba code is called by every keystroke. Eg if the new multiplier gets the value 1.2345, than the code is called by "1", ".", "2", "3", "4" and "5". When the code is triggered by "On enter", than the code is only executed when a new value is entered, the user leaves the combo box and clicks again on the combo box. Only at this last click the code is executed.
How can I make sure that the user enters a new value and the vba code is only executed once when the user pushes "enter"?
2. The table that is recomputed is shown on the form and is displayed correctly when the code has finished. The place where the XY-graph is located on the form becomes blank after executing the code. The form has several pages, and when I leave the page with XY-graph and then return to it again, the XY-graph is displayed correctly again. Why is this happening and how can I make sure that the XY-graph is displayed correctly when the vba code is finished?
For the record, the last line of the vba code is "Me.Refresh".
Thank you,
Lanox
I am just a self-teached beginning access user, so every usefull comment is welcome.
I have a form that retrieves some parameters X1, ..., Xm (X all together) and a multiplier Y from a database. Then it computes at several points Z1, ..., Zn function values f(X,Y,Zi) and stores them in a table. From this table a XY-graph is constructed and displayed in the form.
In a combo box the user can override the multiplier Y by entering a new multiplier Y. Via vba code, the table with the function values is emptied and filled with the new function values (and points Z offcourse).
There are two problems:
1. When the vba code that recomputes the table is triggered by the "On Change" event of the combo box, the vba code is called by every keystroke. Eg if the new multiplier gets the value 1.2345, than the code is called by "1", ".", "2", "3", "4" and "5". When the code is triggered by "On enter", than the code is only executed when a new value is entered, the user leaves the combo box and clicks again on the combo box. Only at this last click the code is executed.
How can I make sure that the user enters a new value and the vba code is only executed once when the user pushes "enter"?
2. The table that is recomputed is shown on the form and is displayed correctly when the code has finished. The place where the XY-graph is located on the form becomes blank after executing the code. The form has several pages, and when I leave the page with XY-graph and then return to it again, the XY-graph is displayed correctly again. Why is this happening and how can I make sure that the XY-graph is displayed correctly when the vba code is finished?
For the record, the last line of the vba code is "Me.Refresh".
Thank you,
Lanox