using a database access97 please use speaker notes for additional information!
DESCRIPTION
VB formTRANSCRIPT
![Page 1: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/1.jpg)
Using a DatabaseAccess97
Please use speaker notes for additional information!
![Page 2: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/2.jpg)
donor.mdb
![Page 3: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/3.jpg)
VB form
![Page 4: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/4.jpg)
VB formConnect contains Access so it does not have to be reset, for another database it would.
![Page 5: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/5.jpg)
VB form
![Page 6: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/6.jpg)
Text boxes
![Page 7: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/7.jpg)
Text boxes
![Page 8: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/8.jpg)
Output
![Page 9: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/9.jpg)
Change
Before change
After change
![Page 10: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/10.jpg)
PrDonor1.vbp
The click events are programmed to move through the Recordset called datDonor as using methods as coded above.
![Page 11: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/11.jpg)
PrDonor1.vbp
Visible set to False for datDonor so the data control does not appear on the form.
![Page 12: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/12.jpg)
PrDonor2.vbp
Private Sub cmdChangeCity_Click() datDonor.Recordset.Edit datDonor.Recordset.Fields("City").Value = txtChangeCity datDonor.Recordset.UpdateEnd Sub
Before
After
![Page 13: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/13.jpg)
PrDonor3.vbp
![Page 14: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/14.jpg)
PrDonor3.vbp
Private Sub cmdAdd_Click() datDonor.Recordset.AddNewEnd Sub
The record is added at the end of the table, but when we next view the table it is in order by Idno because Idno is the index or primary key.
![Page 15: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/15.jpg)
PrDonor3.vbp
Idno is the index or primary key so when we view the donor table, it is in order by index or primary key.
![Page 16: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/16.jpg)
PrDonor3.vbp
I clicked the delete record button. As you can see the record is no longer on the table.
Private Sub cmdDelete_Click() datDonor.Recordset.DeleteEnd Sub
![Page 17: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/17.jpg)
PrDonor3.vbp
![Page 18: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/18.jpg)
PrDonor4.vbp
Find Id results in the input box where the user can enter the id number of the record they want to locate.
![Page 19: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/19.jpg)
PrDonor4.vbp
I have keyed in the city that I want to find in Data To Find. When I click Find City, it will move to that record.
![Page 20: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/20.jpg)
PrDonor4.vbp
![Page 21: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/21.jpg)
PrDonor5.vbp
![Page 22: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/22.jpg)
PrDonor5.vbp
When Find City is clicked, the program looks for a match to the city entered in the city text box and displays the information from that record.
![Page 23: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/23.jpg)
PrDonor5.vbp
Dim wkFoundInd As String
Private Sub cmdExit_Click() EndEnd Sub
Private Sub cmdFindCity_Click()wkFoundInd = "No "datDonor.Recordset.MoveFirstDo While wkFoundInd = "No " And Not datDonor.Recordset.EOF If UCase(datDonor.Recordset.Fields("City").Value) = UCase(txtCity) Then wkFoundInd = "Yes" txtIdno = datDonor.Recordset.Fields("Idno").Value txtName = datDonor.Recordset.Fields("Name").Value Else datDonor.Recordset.MoveNext End IfLoopIf wkFoundInd = "No " Then MsgBox "City entered is not on file", vbOKOnly, "Message" datDonor.Recordset.MoveFirstEnd IfEnd Sub
Compares the data in the city field on the database to the data keyed into txtCity. The comparison is made using upper case versions of both sides to assure maximum chance of success.
I am now going to the recordset fields and getting the values to put into the text boxes.
![Page 24: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/24.jpg)
Private Sub cmdFindId_Click()wkFoundInd = "No "datDonor.Recordset.MoveFirstDo While wkFoundInd = "No " And Not datDonor.Recordset.EOF If datDonor.Recordset.Fields("Idno").Value = txtIdno Then wkFoundInd = "Yes" txtName = datDonor.Recordset.Fields("Name").Value txtCity = datDonor.Recordset.Fields("City").Value Else datDonor.Recordset.MoveNext End IfLoopIf wkFoundInd = "No " Then MsgBox "Id number entered is not on file", vbOKOnly, "Message" datDonor.Recordset.MoveFirstEnd IfEnd Sub
PrDonor5.vbp
Compares the data in the Idno field on the database to the data keyed into txtIdno.
I am now going to the recordset fields and getting the values to put into the text boxes.
![Page 25: Using a Database Access97 Please use speaker notes for additional information!](https://reader035.vdocuments.mx/reader035/viewer/2022062317/5a4d1b8f7f8b9ab0599c09c5/html5/thumbnails/25.jpg)
DAO (Data Access Objects)