Thursday, 10 December 2015

Common dialog control- Font and Color Dialog in Visual Basic 6.0

Visual Basic 6.0 Tutorial:Working with Common Dialog Control and its different Dialogs i.e Open,Save,Color,Font,Print and Help.
Video tutorial is focused on following points:
1.How to add Common Dialog Control 6.0 into VB form.
2.How to use different dialogs (Open,Save,Color,Font,Print and Help) with this control.
3.How to use different methods /Actions to invoke a particular dialog.
4.How to work with Font Dialog  and its different flags in detail.
(How to add specific fonts and Style,effects .colors ,Help to font dialog and how  to make them functional with code.)
5.How to work with Color Dialog and its different flags in detail.
(How to add different color options (Custom colors,Full Colors,Disable custom color)onto the color dialog and use them with text and background etc)

Source Code:
For Color Dialog Button
Private Sub colorbtn_Click()
On Error GoTo errorfix
dialogtest.Flags = &H1
Form1.BackColor = dialogtest.Color
End Sub
For Font Dialog button
Private Sub fontbtn_Click()
On Error GoTo errorfix
dialogtest.Flags = &H3 Or &H100 Or &H4
txtsample.FontName = dialogtest.FontName
txtsample.FontBold = dialogtest.FontBold
txtsample.FontItalic = dialogtest.FontItalic
txtsample.FontSize = dialogtest.FontSize
txtsample.FontStrikethru = dialogtest.FontStrikethru
txtsample.FontUnderline = dialogtest.FontUnderline
txtsample.ForeColor = dialogtest.Color
End Sub

for more Visual Basic tutorials,please visit
Youtube Channel:
Computer Gyan Blog:

Tuesday, 8 December 2015

Search Records in Database (By Name or ID)-Visual Basic6.0 -Ms Access

How to search records in the database by entering either Name or Roll No/ID -Visual Basic 6.0 and MS Access Database Application.
 In my earlier tutorial,I demonstrate-How to Add,Delete,Update and Clear Records.,
Now ,I am going to Add one more feature to this Application.
So In this tutorial,I demonstrate-How can you search a particular record in the database by entering either Roll No/ID or Name in the Textbox on the form.
 Following features covered:
1.How to make necessary changes in database connection (ADODC) for searching records in the database.
2.How to search records by Roll No/ID in the Database.
3.If Record is not available in the database,Then A warning Message box (Record Not Found-search for any other Roll No/ID) Appears.
4.How to search existing records by Name in the database

Source Code:
Double click on Go Button and Write the following code.
Private Sub gobtn_Click()
Studentdb.RecordSource = "select * from Student_Info where RollNo ='" + rollsearch.Text + "'or Name ='" + rollsearch.Text + "'"
If Studentdb.Recordset.EOF Then
MsgBox "Record Not Found ,Please Try any other Rollno", vbInformation
Studentdb.Caption = Studentdb.RecordSource
End If
End Sub

  If you have any queries,suggestions or problems,please leave comments.
 for more Visual Basic tutorials,Visit Youtube Channel: Computer Gyan Blog: Do share and Subscribe to my channel :-)