A Simple Add, Edit, Delete, and Search using VB and MSAccess

This is a sample program on how to Add, Edit, Delete, and Search entries in database using VB and MS Access. Hope my code help you.
NOTE: THIS PROGRAM USES OCX, YOU MUST INSTALL THE PROJECT COMPONENTS BEFORE RUNNING THE PROGRAM.
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
Comments
My command Button is not working please help me.
Private Sub cmdSearch_Click()
If Me.cmbSearch.Text = "" Or Me.txtSearch.Text = "" Then
MsgBox "All fields are required!", vbExclamation, "Error"
Exit Sub
End If
Select Case LCase(Me.cmbSearch.Text)
Case "Last Name"
SQL = "SELECT tbl_info.lastname, tbl_info.id_info, tbl_info.lastname, tbl_info.firstname, tbl_info.area, tbl_info.department, tbl_info.badge, tbl_info.cid, tbl_info.date_hire, tbl_info.date_resigned " & _
"From tbl_info WHERE (((tbl_info.lastname) Like '" & Me.txtSearch.Text & "%')) order by tbl_info.lastname asc;"
Unload Me
Call goSearch(SQL)
Case "Badge No"
SQL = "SELECT tbl_info.badge, tbl_info.id_info, tbl_info.lastname, tbl_info.firstname, tbl_info.area, tbl_info.department, tbl_info.badge, tbl_info.cid, tbl_info.date_hire, tbl_info.date_resigned " & _
"From tbl_info WHERE (((tbl_info.badge) Like '" & Me.txtSearch.Text & "%')) order by tbl_info.lastname asc;"
Unload Me
Call goSearch(SQL)
End Select
End Sub
My command Button is not working please help me.
are this columns not in the same table?
else we can:
DATA WILL DISPLAY TO YOUR LISTVIEW AS SOON AS YOU ARE TYPING LETTERS TO YOUR TEXTBOX OR CHANGING STRINGS ON YOUR COMBO BOX.
i need help pleas
Project po kc nmin sa subject na Software Engineering na gumawa ng System Software...if there's anyone here kind enough to teach me and help me to do my project please with all my gratitude im begging you to teach me...pls pls pls...any idea is accepted as long as maintindihan ko po...im just a beginner po kc...thanks so much.
please email me at...mhike_strong@yahoo.com
waiting for positive response...
codes for null values
..sir pwede mg.ask about sa codes for null values....f u have time email to bbder_08@yahoo.com...
problem with creating database in vb.net
sir i have written a command in sql that is create database college.,but there was a error message that master cant create database ,access denied ,,,,,,,tell me step by step solution for this problem.
Set Item = .Add(, ,
Set Item = .Add(, , RS!trans)
Item.SubItems(1) = RS!E
Item.SubItems(2) = RS!T
Item.SubItems(3) = RS!em
Item.SubItems(4) = RS!tm
Run-time error '3265':
item cannot be found in the collection corresponding to the requested name or ordinal.
please send any solution to my email sit_me@yahoo.com.ph
help
in the vb project Add, Edit, Delete, Search i want add a few more tabs that is columns like email id , dob etc can u pls give me the steps to do tat
hai
hai can u give me a code that have insert,deleteand search plzzzz....
hi poh
plz help me for the code that can edit,save,preview cancel,search,and delete
using vb msaccess...plz poh
=)
private sub cmdsave_click()
with adodc1.recordset
.addnew
.fields(0) = txtId_number.text
.fields(1) = txtFirstname.text
.fields(2) = txtMiddlename.text
.fields(3) = txtLastname.text
.update
end with
end sub
private sub cmddelete_click()
on error resume next
dim confirm as string
confirm = msgbox("sigurado ka na gusto mong burahin itong record?",vbExclamation+vbYesOrNo,"Confirm"
if confirm = vbYes then
adodc1.recordset.delete
msgbox"Itong Record ay burado na",vbOkOnly,"Burado"
else
msgbox"Nakansela ang pagbubura",vbOkOnly,"Kansela"
end if
end sub
yan po sana Kahit pano mkatulong po Godbless......
hi
Where is the code for Search my dear....
hi
hi i found ur program very useful
however can u help me coz im using Mysql5.0 as database
and i want to know how deleting of records goes
and also the sorting (Highest - Lowest)
im using VB 2008 and Mysql any help will be much appreciated!
Godbless!
HELP
hi i found ur program very useful
however can u help me coz im using Mysql5.0 as database
and i want to know how deleting of records goes
and also the sorting (Highest - Lowest)
im using VB 2008 and Mysql any help will be much appreciated!
Godbless!
hi
can you help me doing my project. please...
project
hello
can u tell me how can i use a progressbar to count the records in the databae ?
tnk u
code plzz..
hi!.. can you give me the code of add, edit, delete and search.. thank you..!
pls.........
can you give me the simple code for add,edit,delete,print,clear using the vb.net?connected to the sql.....
VB code - Access base -
plz giv VB code - record set Add, New, Edit, Delete, previous, next last, and first
can you help my project. please...
Sir,
can you give me the simple code for add,edit,delete,print,previous, next, using the VB.connected to the MS access and excel.
ichus
Public dbCN As
Public dbCN As ADODB.Connection
Public Uname As String
'Connect to database
Public Function DBConnect() As Boolean
On Error GoTo OpenErr
Dim MSDatabase
Set dbCN = New ADODB.Connection
MSDatabase = App.Path & "\" & "library1.mdb"
dbCN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MSDatabase & ";Persist Security Info=False;Jet OLEDB:Database Password = "
DBConnect = True
Exit Function
OpenErr:
MsgBox "Error Opening " & MSDatabase & vbNewLine & Err.Description, vbCritical, "Open Database Error"
DBConnect = False
End Function
Hi! can you help me how to
Hi! can you help me how to delete, add, search, and edit records from access database using text boxes, datagridview in vb 2010.., thanks poh! Godbless!!!
can i have a code of add, edit delete save next prev.
pleaswe?
VISUAL BASIC
Public dbCN As ADODB.Connection
Public Uname As String
'Connect to database
Public Function DBConnect() As Boolean
On Error GoTo OpenErr
Dim MSDatabase
Set dbCN = New ADODB.Connection
MSDatabase = App.Path & "\" & "library1.mdb"
dbCN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & MSDatabase & ";Persist Security Info=False;Jet OLEDB:Database Password = "
DBConnect = True
Exit Function
OpenErr:
MsgBox "Error Opening " & MSDatabase & vbNewLine & Err.Description, vbCritical, "Open Database Error"
DBConnect = False
End Function
Codings for textbox
Sir,
Please send how to insert time format in a textbox(00:00:00 AM/PM) with time calculations.And the codes for edit, delete in vb.net connecting sql server? kavi.it10@gmail.com
how to search a particular
how to search a particular record in vb6 by using data control pls tell me code
by sridhar
good evening.
i just want to ask, what is the code for deleting the files?
toolstrip gmit ku. then i want to delete the files na nandun. i used database with MS Access 2007.then visual basic 2008 gmit ku. ge thank you.
hi
hlow sir how to connect vb6 to msAccess using adodc.tnx sir plz hlp me
help
wats wrong po wid these codes...search button po
Private Sub cmdfind_Click()
Dim Find As String
Dim sBookmark As String
Find = InputBox("Please Enter ID number:", "ID number")
Find = Trim$(search) 'remove surplus spaces
If Find "" Then 'cancel if nothing entered
With Datenrolment.Recordset
sBookmark = .Bookmark
.FindFirst "id like'" + Find + "*'"
If .NoMatch Then 'record not found
MsgBox "Sorry, No record found.", vbCritical, "Error"
.Bookmark = sBookmark
End If
End With
End If
Datenrolment.Recordset.OpenRecordset
cmdedit.Enabled = True
cmdexit.Enabled = True
End Sub
redmist
.FindFirst "id like'" & Find & "%'"
vb 2010
can i apply this on vb 2010, thanks!
tulong po...
ANU PO BA AND CODE NG ADD,DELETE AT EXIT PG GNAMIT MO PO SA FOXPRO..
EMAIL NIO PO SA dumalaguej@yahoo.com
salamt po....
Foxpro add delete exit
email mo ko. jgerald_molina@yahoo.com turuan kita ^^
Dim cn As
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub cmdAdd_Click()
cmdAdd.Enabled = False
cmdSave.Enabled = True
rs.AddNew
ClearFields
End Sub
Public Sub ClearFields()
Text10.Text = ""
Text9.Text = ""
Text8.Text = ""
Text7.Text = ""
Text6.Text = ""
cboGender.Text = "choose"
End Sub
HI POH
sir! how to connect visual basic 6.0 to MSAccess with add, delete, edit, preview,
gud day sir..
can u give me the code of edit and how to maintenance in ms access
tank u sir...e2 email q germangolbeque20@yahoo.com
i need help...pls. somebody
i need a complete code for search engine for my enrollment system using visualbasic2008 express edition...tnx poh...kindly email it to dounigwapo@ymail.com
tnx a lot and God speed
MS access 2010
Dear sir/madam:
I had use a "cdobox1" in my form, to do a getitem in my field for table "Remark".
I want the content in the "Remark" from the table to display in my "txtbox1" in my form.
what can i do?
Happy,
BEST FOR EVERY STUDENT.
hi all..
can u plz help me to find a code for searching...
i cnt add...
Private Sub cmdAdd_Click()
With Adodc1.Recordset
.AddNew
.Fields(FName) = txtFirstName.Text
.Fields(LName) = txtLastName.Text
.Fields(MI) = txtMI.Text
.Fields(Add) = txtADD.Text
.Fields(Phone) = txtPNum.Text
.Fields(Mobile) = txtMNum.Text
.Fields(Nationality) = txtNat.Text
.Fields(Email) = txtEAdd.Text
.Fields(Status) = CboStat.Text
.Fields(Gender) = CboGen.Text
.Fields(Age) = txtA.Text
.Update
End With
End Sub
the word inside the open/close parenthesis is my field name.......
run-time error '3265':
Item cannot be found in the collection corresponding to the requested name or ordinal.
but still it saves my data but also it replaces the 1st data i already saved....
pls help me, this error is causing me headache....
here's my email, gs.gladys_sacueza@yahoo.com
hope someone can reply.... thank so much
pls help me
sir. . .can you help me. . .what codes in edit,delete,save, in vb2008 express edition. . .sir. . .no data base sir. . .pls.. .in vb2008 only. . .no have backend. . .tnx. . .u can send me sir in my. ..email or rply pls. . .tnx ulit. . .
same problem
same problem pls email the correct code tnx... paoluck19@yahoo.com
...
You did not enclose youre fieldnames with doublequotes like this .Fields("FName"); See if it works!
try dis code
Private Sub cmdAdd_Click()
With Adodc1.Recordset
.AddNew
.Fields("FName") = trim(txtFirstName.Text)
.Fields("LName") = trim(txtLastName.Text)
.Fields("MI") = trim(txtMI.Text)
.Fields("Add") =trim( txtADD.Text)
.Fields("Phone") = trim(txtPNum.Text)
.Fields("Mobile") =trim( txtMNum.Text)
.Fields("Nationality") = trim(txtNat.Text)
.Fields("Email") = trim(txtEAdd.Text)
.Fields("Status") = trim(CboStat.Text)
.Fields("Gender") =trim( CboGen.Text)
.Fields("Age") =trim( txtA.Text)
.Save
adodc1.refresh
End With
End Sub
help me
paano mag gawa ng code sa vb .net 2008 ex. add , save
add,update,delete
please help i want a code of add,update,delete in asp.net
-------Simple add, edit delete and search codes-------
Good day! I am your one of the followers here. sir can you help me out, in your given example downloadable code in simple add, edit, delete and search.. i added one column in your database to get the output in currency. dko mapalabas sa list view yong amount. ng idinagdag ko na column sa access database. pakitulungan mo naman ako please..... send mo sa email ko ang codes. its mikki_gwapito@yahoo.com. salamat po.
Erman Murilla
-----DELETE EDIT and SEARCH PROBLEM-----
Sir good day may project po akong CASH BOND PROGRAM in which kung saan lalabas lahat ng total cashbond ng empleyado kung magkanoi na binabayad sa loob ng pinasok nyang araw. inipattern ko sa downloadable add edit delete at search mo. pd bang gawan mo ko ng sample na code saung simple program. nag dagdag me ng isang column sa database access named cashbong kung san lalabas ang 50.00 na ouput napalabas ko sa database pero ayaw lumabas sa listview ng form 1 mo na example. ano kaya problems. tulungan mo naman me send mo sa email ko.. gawin mo na pati yng program at usap nalang tau how much... mikki_gwapito@yahoo.com.
tnx....
Erman Murilla
Pls give a code for search
Sir,
I'm doing my project using vb6 (using data form wizard to connect to database) and ms access as my database. Sir pls help me code for search, here is my email address yarisson4life@yahoo.com.
Thank sir
VB.NET
is it working in VB.NET ??
Pages
Add new comment