What's new

Closed Visual basic 6.0 + ms access

Status
Not open for further replies.

PHC-Evo

Eternal Poster
Established
Joined
Jun 21, 2014
Posts
1,311
Reaction
312
Points
497
Pa hingi ng magandang program gamit visual basic 6.0 + database MS access :)
Thank you
 
how about yung merun ng seacrh button bro ?
Private Sub Command1_Click()
Adodc2.RecordSource = " select * from Tablenae where Fieldaname = " & Text1.Text & ""
If Adodc2.Recordset.EOF = True Then
MsgBox "Record not found"
Else
DataGrid1.datasource = Adodc2.recordsource
DataGrid1.Refresh
End If
End Sub

sa datagrid yan tol,, alam mo namn cguro pano mag connect
 
Private Sub Command1_Click()
Adodc2.RecordSource = " select * from Tablenae where Fieldaname = " & Text1.Text & ""
If Adodc2.Recordset.EOF = True Then
MsgBox "Record not found"
Else
DataGrid1.datasource = Adodc2.recordsource
DataGrid1.Refresh
End If
End Sub

sa datagrid yan tol,, alam mo namn cguro pano mag connect

oo alam ko peru yung search box na mean ko ay yung dun lalabas kung saan ka nag input ng name gender age *** birthday ganun xD
 
Private Sub cmdCancel_Click()

txtSerialNo.Text = ""
txtName.Text = ""
txtSurname.Text = ""
txtSex.Text = ""
txtAddress.Text = ""
txtCity.Text = ""
txtZipCode.Text = ""
txtContactNo.Text = ""
txtOccupation.Text = ""
txtFamilyMembers.Text = ""
txtAppliedOn.Text = ""
txtNoCylinder.Text = ""
txtTypeConnection.Text = ""

End Sub

Private Sub cmdSearch_Click()

txtSerialNo.Enabled = True
txtName.Enabled = True
txtSurname.Enabled = True
txtSex.Enabled = True
txtAddress.Enabled = True
txtCity.Enabled = True
txtZipCode.Enabled = True
txtContactNo.Enabled = True
txtOccupation.Enabled = True
txtFamilyMembers.Enabled = True
txtAppliedOn.Enabled = True
txtNoCylinder.Enabled = True
txtTypeConnection.Enabled = True

If txtSerialNo.Text = "" Then
MsgBox " Please enter Serial No to search "
Exit Sub

Else
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\GASAGENCYdb.mdb"
.RecordSource = "Select * from CustomerDetails Where SerialNo = " & txtSerialNo.Text
.Refresh
End With

If Adodc1.Recordset.BOF = True Or Adodc1.Recordset.EOF = True Then
MsgBox " No Record Found "
txtSerialNo.Text = ""
Exit Sub

Else

txtName.Text = Adodc1.Recordset.Fields(1)
txtSurname.Text = Adodc1.Recordset.Fields(2)
txtSex.Text = Adodc1.Recordset.Fields(3)
txtAddress.Text = Adodc1.Recordset.Fields(4)
txtCity.Text = Adodc1.Recordset.Fields(5)
txtZipCode.Text = Adodc1.Recordset.Fields(6)
txtContactNo.Text = Adodc1.Recordset.Fields(7)
txtOccupation.Text = Adodc1.Recordset.Fields(8)
txtFamilyMembers.Text = Adodc1.Recordset.Fields(9)
txtAppliedOn.Text = Adodc1.Recordset.Fields(10)
txtNoCylinder.Text = Adodc1.Recordset.Fields(11)
txtTypeConnection.Text = Adodc1.Recordset.Fields(12)

End If
End If

End Sub


ok na..
 
Private Sub cmdCancel_Click()

txtSerialNo.Text = ""
txtName.Text = ""
txtSurname.Text = ""
txtSex.Text = ""
txtAddress.Text = ""
txtCity.Text = ""
txtZipCode.Text = ""
txtContactNo.Text = ""
txtOccupation.Text = ""
txtFamilyMembers.Text = ""
txtAppliedOn.Text = ""
txtNoCylinder.Text = ""
txtTypeConnection.Text = ""

End Sub

Private Sub cmdSearch_Click()

txtSerialNo.Enabled = True
txtName.Enabled = True
txtSurname.Enabled = True
txtSex.Enabled = True
txtAddress.Enabled = True
txtCity.Enabled = True
txtZipCode.Enabled = True
txtContactNo.Enabled = True
txtOccupation.Enabled = True
txtFamilyMembers.Enabled = True
txtAppliedOn.Enabled = True
txtNoCylinder.Enabled = True
txtTypeConnection.Enabled = True

If txtSerialNo.Text = "" Then
MsgBox " Please enter Serial No to search "
Exit Sub

Else
With Adodc1
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\GASAGENCYdb.mdb"
.RecordSource = "Select * from CustomerDetails Where SerialNo = " & txtSerialNo.Text
.Refresh
End With

If Adodc1.Recordset.BOF = True Or Adodc1.Recordset.EOF = True Then
MsgBox " No Record Found "
txtSerialNo.Text = ""
Exit Sub

Else

txtName.Text = Adodc1.Recordset.Fields(1)
txtSurname.Text = Adodc1.Recordset.Fields(2)
txtSex.Text = Adodc1.Recordset.Fields(3)
txtAddress.Text = Adodc1.Recordset.Fields(4)
txtCity.Text = Adodc1.Recordset.Fields(5)
txtZipCode.Text = Adodc1.Recordset.Fields(6)
txtContactNo.Text = Adodc1.Recordset.Fields(7)
txtOccupation.Text = Adodc1.Recordset.Fields(8)
txtFamilyMembers.Text = Adodc1.Recordset.Fields(9)
txtAppliedOn.Text = Adodc1.Recordset.Fields(10)
txtNoCylinder.Text = Adodc1.Recordset.Fields(11)
txtTypeConnection.Text = Adodc1.Recordset.Fields(12)

End If
End If

End Sub


ok na..
ayaw tol eh .. debug
 
Status
Not open for further replies.

Similar threads

Back
Top