Several Access Questions
during my work I accumulated some questions:
I have an indep开发者_StackOverflowendent datasheet view form, how can I change its size when it is opened? For example by default it displays 5 columns and 10 rows and the form is just that big.
I need to execute several sql clauses, inserts, updates and delete for example. How to use a transaction in Access to bind them together?
In some situation I need to decrease a number field in a record. When this number field becomes 0, the record will be deleted or moved in another table. What I'm doing now is firstly using a SELECT clause to take the number field, then minus 1 and test, if it's 0, I do another sql clause to delete the record or move it. Any better way to do this?
In the Northwind sample DB provided with Access 2007, the form-head is nice looking, but how it is done? It is a background picture or a theme?
Thanks!
You really want to handle the Resize event for the form. Get its current size, and change the number of rows and columns accordingly. Change the Border Style so that the form is resizeable, if you have not already done so.
In VBA, you define a transaction on the workspace, viz:
Set wrkCurrent = DBEngine.Workspaces(0) wrkCurrent.BeginTrans ... wrkCurrent.BeginTrans
You could use a VBA RecordSet object instead, if you want to be more efficient.
That would be an embedded bitmap. But generally speaking Access is useless when it comes to graphics. Forget the eye candy, and keep your user interface as simple as possible.
精彩评论