Jumat, 28 November 2008

Use Visual Basic to modify form properties

1. Start Access and open the database we created in the last tute, select the 'Forms' tab and select the 'Baseline Form' then hit the 'Design' button. If you did not compete the last tute you can download the database click here to download.
2. Select the first option group 'Frame15' and look at the properties of that object, select the 'Event' tab choose the 'On Click' property and hit the build button.
3. Type in the follow code, this reads if the Q1 object on the form = 1 then switch off the Q2 & Q3 objects (make them invisible) else make them visible.
4. Try the form with the new code.
5. When Q1=1 then Q2 & Q3 are set to invisible mode. This code could be extended such that you don't see any questions until the previous question has been answered, close the form.
6. This is the single most important piece of code you will ever use in Access, Dim MyDB As Database, MyREC As Recordset, criteria1 As StringSet MyDB = DBEngine.Workspaces(0).Databases(0)Set MyREC = MyDB.OpenRecordset("Participants", DB_OPEN_DYNASET)criteria1 = "FirstName = 'myle'"MyREC.FindFirst criteria1MyREC.EditMyREC!Title = "datatest"MyREC.Update
Go to the modules tab and press the new key to create a new module.
7. Create a new function called 'DataTest'.
8. Save the module as 'TestModule'
9. Copy the above code into the new function. 10. Table before code runs.
11. Table after code runs. Copyright © 1999 R&D Robotics Pty Ltd, All rights reserved. Any copyright subsisting in the above code and or literary works including source files vests with R&D Robotics Pty Ltd. ACN 086 345 137

Tips n trick visual basic

Tips n Trick in use visual basic
1. First Part
This tutorial will help start-up any beginner or intermediate programming into Visual Basic as it explains using the toolbars controls and what they do. If you like it then please leave your comments etc and I may consider finishing it off :)

2. Sql Backup Utility using visual basic
With this utility you can make .mdf backup and restore backup from an VB 2005 application. You can add this tool to your project. I want a partner to add some stuff to this utility please email me.

3. Tetris in visual basic
Tetris .NET (World Edition) by Trent Jackson :: A complete, fully featured game of contemporary 2D Tetris written in Visual Basic .NET. The game Implements GDI+ resources to provide a good assortment of smooth, animated, flicker-free graphics throughout.