Database Design:: Visual Basic
Database Design:: Visual Basic
The first step is to design a database using Data Manager (or Access). My database is
a single table (named MYSTUFF). Its specifications are:
This database is saved as file HomeInv.mdb. Create a data link to your database. The
link is saved as HomeInv.udl.
Report Design:
The second step is to use the Data Environment and Data Report designers to setup
how you want the printed home inventory to appear. Use your discretion here. My
final report design is saved in denHomeInv and rptHomeInv. We will access this
report from our Visual Basic application. My Data Report design looks like this:
Project Design:
Form:
Properties:
Form frmHome:
BorderStyle = 1 - Fixed Single
Caption = Home Inventory
CommandButton cmdExit:
Caption = E&xit
CommandButton cmdShow:
Caption = Show &Report
CommandButton cmdPrevious:
Caption = &Previous Item
CommandButton cmdNext:
Caption = &Next Item
CommandButton cmdDelete:
Caption = &Delete Item
CommandButton cmdAdd:
Caption = &Add Item
TextBox txtLocation:
DataField = Location
DataSource = dtaHome
FontName = MS Sans Serif
FontSize = 9.75
MaxLength = 40
TextBox txtValue:
DataField = New Value
DataSource = dtaHome
FontName = MS Sans Serif
FontSize = 9.75
TextBox txtDate:
DataField = Date Purchased
DataSource = dtaHome
FontName = MS Sans Serif
FontSize = 9.75
MaxLength = 20
TextBox txtSerial:
DataField = Serial Number
DataSource = dtaHome
FontName = MS Sans Serif
FontSize = 9.75
MaxLength = 20
TextBox txtItem:
DataField = Item
DataSource = dtaHome
FontName = MS Sans Serif
FontSize = 9.75
MaxLength = 40
Label Label5:
Caption = Location
FontName = Times New Roman
FontSize = 12
Label Label4:
Caption = New Value
FontName = Times New Roman
FontSize = 12
Label Label3:
Caption = Purchase Date
FontName = Times New Roman
FontSize = 12
Label Label2:
Caption = Serial Number
FontName = Times New Roman
FontSize = 12
Label Label1:
Caption = Item
FontName = Times New Roman
FontSize = 12
Code:
General Declarations:
Option Explicit