Beruflich Dokumente
Kultur Dokumente
MicrosoftAccess:MedicalDatabase
LearningObjectives:
CreatingAccessdatabase;
Defininganewtable;
Enteringandeditingdataintables;
Settingrelationshipsbetweentables;
Designingaquery;
Designingandusingforms;
Designingandusingreports.
Exercise
You are a general practitioner and have a medical office. You have two thousand patients. For
managing patients consultations data you want to create a database (a Microsoft Access
database).
1.CreateanewfoldernamedLP_04onyourpartitionontheserver.
1.CreateanewMicrosoftAccessfile(StartProgramsMicrosoftAccess).FromtheFilemenu
chooseNewBlankdatabase.ThenameofthedocumentwillbePatientDatabaseandmustbe
savedintoLP_04folder.
2.Createtwotables:FromtheObjectscolumnchooseTables,thenchooseCreatetableinDesign
view.
ThefirsttableiscalledPatientsandwillhavethefollowingfieldsseefigurebelow:
Hints:
Primary key: The primary key for the table Patients should be a field named
IdPatient;inthetableConsultationstheprimarykeyshouldbethefields:NumPac
andDateOfConsultation.
);
OpenatableinDesignviewbyclickingontheDesignbutton(
Selectthefieldorfieldsyouwanttodefineastheprimarykey.
Toselectonefield,clicktherowselectorforthedesiredfield;
Toselectmultiplefields,holddowntheCTRLkeyandthenclicktherowselectorfor
eachfield.
ClickthePrimaryKeybuttononthetoolbar.
-1-
ThenexttablesnameisConsultationsanditwillcontainthefollowingfieldsseefigurebelow:
3.CreatearelationshipbetweenthetablePatientsandthetableConsultations.
Hints:
Tocreatearelationshipbetweenthetwotables:
InDesignview,openthetablenamedConsultations;
ClickintheNumPacfieldrowandintheDataTypecolumn,clickthearrowand
selectLookupWizard
InthefirstdialogboxoftheLookupWizard,selecttheoptionthatindicatesyou
wanttheLookupfieldtolookupthevaluesinatableorquery
-2-
.
Click Next and follow the directions in the remaining Lookup Wizard dialog
boxes. In the Which table or query should provide the value for your lookup
column?dialogboxchoosethetablenamedPatients.Fromthenextdialogbox,
choosethefieldSecondName
When you click the Finish button, Microsoft Access creates a Lookup field
whosepropertiesarebasedonthechoicesyoumadeinthewizard.
4.Inordertofillthedatabasewithregistrations,createaformnamedPatientConsultations.
Hints:
FromtheAccessObjectschooseForms;
DoubleclickonCreateFormsbyusingwizard;
ChoosetablePatientsandselectallfields,afterthatselectConsultationstable
andselectallfieldsexceptNumPacfield;
-3-
Choosenext,andfinish.
UsingtheFormintroducedataforatleast5patients.Everypatientshouldhaveat
leasttwoconsultations.
5.CreateaquerynamedFirstQueryfindwhichpatientsglycemia(bloodsugar)ishigherthan110.
Hints:
FromtheAccessObjectschooseQueries;
DoubleclickonCreateQueryinDesignview;
Click on the table Patients and after that clickon the Add button. Repeat the
samestepstoaddtheConsultationstable;
Choose from the table Patients the fields SecondName, FirstName and
DateOfBirth and from the table Consultation choose the fields
DateOfConsultation and Glycemia. As criteria introduce >=110 for the column
Glycemia
6. Create a report containing the patients that have a Glycemia higher than 110 (using the
informationcontainsintothepreviouscreatedquery).
FromtheAccessObjectschooseReports;
DoubleclickonCreateReportbyusingwizard;
FromtheTables/Queriesdialogbox,chooseFirstQuery;
Sortdatafromthereportasshowninthefigurebellow:
-4-
Followthenextstepstofinishthereport.SavethereportasFirstReport.
-5-