0% found this document useful (0 votes)
51 views

VB PROJECT New Edit Tusar

The document describes code for a form application in Visual Basic. It includes code to: 1) Add and display the sum of two text boxes in a third box. 2) Clear the text in three text boxes. 3) Change the background color of the form. 4) Change formatting of text like bold, italic, underline and font size. 5) Add and remove items from a combo box. 6) Calculate and display the average of values in three text boxes. 7) Display a letter grade based on the average. 8) Connect the form to an Access database using ADO and populate text boxes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

VB PROJECT New Edit Tusar

The document describes code for a form application in Visual Basic. It includes code to: 1) Add and display the sum of two text boxes in a third box. 2) Clear the text in three text boxes. 3) Change the background color of the form. 4) Change formatting of text like bold, italic, underline and font size. 5) Add and remove items from a combo box. 6) Calculate and display the average of values in three text boxes. 7) Display a letter grade based on the average. 8) Connect the form to an Access database using ADO and populate text boxes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

V.

B PROJECT
CLASS -2

RIGHT CLICK ON THE COMBO BUTTON AND VIEW CODE


DISPLAY
Private Sub Command1_Click()

Text3.Text = Text1.Text + Text2.Text

End Sub
CLEAR

Private Sub Command2_Click()

Text1.Text = " "

Text2.Text = " "

Text3.Text = " "

End Sub
RIGHT CLICK ON THE COMBO BUTTON AND VIEW CODE

RED

Form1.BackColor = vbRed
GREEN

Form1.BackColor = vbGREEN
BLUE

Form1.BackColor = vbBLUE

PINK

Form1.BackColor = vbPINK
YELLOW

Form1.BackColor = vbYELLOW
ORANGE

Form1.BackColor = vbORANGE
CLASS -3

RIGHT CLICK ON THE COMBO BUTTON AND VIEW CODE


BOLD

Text1.FontBold = Not Text1.FontBold


ITALIC

Text1.FontItalic = Not Text1.FontItalic


UNDERLI
NE
Text1.FontUnderline = Not Text1.FontUnderline
StrikethruE
Text1.FontBold = Not Text1.FontStrikethru

FONT SIZE +
Text1.FontSize = Text1.FontSize + 4
FONT SIZE -

Text1.FontSize = Text1.FontSize – 4
CLASS -4

RIGHT CLICK ON THE COMBO BUTTON AND VIEW CODE


Add itemsNE

Private Sub Label11_Click()


Combo1.AddItem Text10.Text
Text10.Text = " "
End Sub
Remove items

Private Sub Label12_Click()


Combo1.RemoveItem Combo1.ListIndex
End Sub
Powerpoint text
box
Private Sub Text6_Change()
If (Text4.Text) > 0 Then
Text7.Text = (Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text))
Text8.Text = (Val(Text7.Text)) / 3
Else
Text7.Text = " "
End If
End Sub
click box

Private Sub Command1_Click()


If (Val(Text8.Text > 80)) Then
Text9.Text = A
ElseIf (Val(Text8.Text > 50)) Then
Text9.Text = B
ElseIf (Val(Text8.Text > 40)) Then
Text9.Text = C
End If
End Sub
After creating this form open access -> create this form -> save format (Access
2002-2003)
Open vb -> project menu -> components (ctrl+t) -> Microsoft ADO data control
6.0 (OLEDB) -> ok -> apply
Draw new ADODC tool -> right click on the ADODC -> properties -> use connection
string-> build-> click -> Microsoft jet 4.0 ole db provider -> next-> select or enter
a database -> brows-> choose access file -> open -> text connection -> ok -> ok ->
record source -> command type (2.adcmd table) -> table on store producer
name((enter table name)
Go to vb form -> create command-> save, previous, next, add
Save-> adodc.recordset.save
Previous-> adodc.recordset.move previous
Next-> adodc.recordset.move next
Add-> adodc.recordset.add new
Select any vb text box-> properties-> data source -> brows -> ADODC 1 -> data
field-> select data field

You might also like