Tải bản đầy đủ (.pdf) (633 trang)

OReilly access hacks tips and tools for wrangling your data apr 2005 ISBN 0596009240

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (15.29 MB, 633 trang )

AccessHacks
ByKenBluttman
...............................................
Publisher:O'Reilly
PubDate:April2005
ISBN:0-596-00924-0
Pages:352

TableofContents|Index|Examples|Errata

AspartoftheMicrosoftOfficesuite,Accesshasbecometheindustry'sleadingdesktop
databasemanagementprogramfororganizing,accessing,andsharinginformation.But
takingadvantageofthisproducttobuildincreasinglycomplexAccessapplicationsrequires
somethingmorethanyourtypicalhow-tobook.WhatitcallsforisAccessHacksfrom
O'Reilly.Thisvaluableguideprovidesdirect,hands-onsolutionsthatcanhelprelievethe
frustrationsfeltbyusersstrugglingtomastertheprogram'svariouscomplexities.For
experiencedusers,AccessHacksoffersauniquecollectionofproventechniquesandtools
thatenablethemtotaketheirdatabaseskillsandproductivitytothenextlevel.ForAccess
beginners,ithelpsthemacquireafirmgraspoftheprogram'smostproductivefeatures.A
smartcollectionofinsidertipsandtricks,AccessHackscoversalloftheprogram'sfiner
points.Amongthemultitudeoftopicsaddressed,itshowsusershowto:workwithAccess
inmulti-userenvironmentsutilizeSQLqueriesworkwithexternaldataandprograms
integrateAccesswiththird-partyproductsJustimagine:alearningprocesswithoutthe
angst.Well,AccessHacksdeliversitwithease,thankstothesedown-and-dirtytechniques
notcollectedtogetheranywhereelse.PartofO'Reilly'sbest-sellingHacksseries,Access
HacksisbasedonauthorKenBluttman'stwodecadesofreal-worldexperiencein
databaseprogrammingandbusinessapplicationbuilding.It'sbecauseofhisvast
experiencesthatthebookisabletooffersuchadeepunderstandingoftheprogram's
expandingpossibilities.



AccessHacks
ByKenBluttman
...............................................
Publisher:O'Reilly
PubDate:April2005
ISBN:0-596-00924-0
Pages:352

TableofContents|Index|Examples|Errata



















































Credits

AbouttheAuthor
Contributors
Acknowledgments
Preface
WhyAccessHacks?
HowtoUseThisBook
HowThisBookIsOrganized
ConventionsUsedinThisBook
UsingCodeExamples
SafariEnabled
HowtoContactUs
GotaHack?
Chapter1.CoreAccess
Section1.1.Hacks112
Hack1.HelpUsersFindtheObjectsTheyNeed
Hack2.PersonalizeYourAccessApplication
Hack3.WorkFastandAvoidTypos
Hack4.OptimizeDataChanges
Hack5.TransferDataBetweenVersionsofAccess
Hack6.OrganizeandEnhanceYourMacros
Hack7.RidYourDatabaseofClutter
Hack8.ProtectValuableInformation
Hack9.WorkwithAnyAmountofData
Hack10.FindDatabaseObjectsinaSnap

















































































Hack11.UseaJunctionTable
Hack12.StoptheDatabasefromGrowing
Chapter2.Tables
Section2.1.Hacks1318
Hack13.CreateanAutoNumberFieldwithaCustomValue
Hack14.CopyDataBetweenTablesWithoutanAppendQuery
Hack15.SteerClearofSystemTables
Section16.HideSensitiveInformation
Hack17.SimulateTableTriggers
Section18.CreateTablesFaster
Chapter3.EntryandNavigation
Section3.1.Hacks1927
Hack19.HelpUsersNavigateThroughLongForms
Hack20.HelpUsersEnterAdditionalText
Hack21.LetUsersAddCustomItemstoPredesignedLists
Hack22.PopulateandSortListswithFlair
Hack23.UseCustomControlsonYourForms
Hack24.ConfirmRecordUpdatesBeforeSaving

Hack25.PutaClockonaForm
Hack26.BeTab-Smart
Hack27.HighlighttheActiveControl
Chapter4.Presentation
Section4.1.Hacks2839
Hack28.SeparateAlphabeticallySortedRecordsintoLetterGroups
Hack29.CreateConditionalSubtotals
Hack30.UseConditionalFormattingtoPointOutImportantResults
Hack31.ProvideaDirectLinktoaReport
Hack32.ProtectIntellectualProperty
Hack33.CreateaSlideshowinAccess
Hack34.PlayVideosinAccessForms
Hack35.ViewReportsEmbeddedinForms
Hack36.PutLineNumbersonaReport
Hack37.ShadeAlternatingLinesonaReport
Hack38.SavePaperbyReducingWhitespace
Hack39.IncludetheDate,Time,andPageCount
Chapter5.QueriesandSQL
Section5.1.Hacks4054
Hack40.ReturnaSampleofRecords
Hack41.CreateBulletproofInsertOperations


















































































Hack42.FindUnmatchedRecordsonMultipleFieldKeys
Hack43.PlaceaGrandTotalinaQuery
Hack44.SortAnyArbitraryStringofCharacters
Hack45.SummarizeComplexData
Hack46.GetAllCombinationsofData
Hack47.Don'tLetNullsRuinDataSummaries
Hack48.UseaCustomFunctioninaQuery
Hack49.CreateAccessTableswithSQLServerScripts
Hack50.UseWildcardsinQueries
Hack51.GetCleanerOr-BasedCriteria
Hack52.GetCleanerAnd-BasedCriteria
Hack53.CreateanOuterJoin
Hack54.UseRegularExpressionsinAccessQueries
Chapter6.MultiuserIssues
Section6.1.Hacks5558
Hack55.TestforDuplication
Hack56.DistributeaSplitDatabasewithPredefinedTableLinks
Hack57.BuildaTime-OutFeature
Hack58.ImplementUniqueUsernames
Chapter7.ExternalProgramsandData

Section7.1.Hacks5971
Hack59.ImportNoncontiguousRangesofDatafromExcel
Hack60.UseExceltoReorientAccessData
Hack61.UseExcelFunctionsInsideAccess
Hack62.UseWordtoCompareDatainTwoAccessTables
Hack63.ImportVariedXMLDataintoAccess
Hack64.ExportXMLDataSanely
Hack65.BreakThroughVBA'sTransformationBarrier
Hack66.LeverageSQLServerPowerbyCallingStoredProcedures
Hack67.ManageWordDocumentsfromAccess
Hack68.UseAccessasaFrontEndtoMySQL
Hack69.SendAccessDataThroughOutlookAutomatically
Hack70.CreateAccessTablesfromOutsideAccess
Hack71.WriteVBAwiththeMacroRecorderinWordandExcel
Chapter8.Programming
Section8.1.Hacks7291
Hack72.StoreInitialControlSelectionsforLaterRecall
Hack73.WriteCodeFasterbyTurningOffSyntax-Checking
Hack74.SubstituteDomainAggregateFunctionsforSQLAggregateFunctions


































































Hack75.ShrinkYourCodewithSubroutines
Hack76.ShrinkYourCodewithOptionalArguments
Hack77.ProtectProgrammingCodefromCuriousUsers
Hack78.BuildaSecretDeveloperBackdoorintoYourApplications
Hack79.HelpUsersDrillDowntoaRecord
Hack80.PreventUsersfromDisablingYourStartupOptions
Hack81.InformUsersofaLongProcess

Hack82.AllowUserstoChooseaBack-EndDatabase
Hack83.OverridetheTimeoutInterval
Hack84.SaveValuesfromUnboundControlsforLaterRecall
Hack85.SortRecordsRandomly
Hack86.Bulk-UpdateControlsonaForm
Hack87.ProvideCompleteXMLControltoAnyVersionofAccess
Hack88.UseCustomEnumerations
Hack89.ConvertTexttotheDesiredCase
Hack90.CreateaCodeLibrary
Hack91.AutomaticallyCheckforDatabaseTableUpdates
Chapter9.Third-PartyApplications
Section9.1.Hacks9295
Hack92.DocumentYourDatabasewithTotalAccessAnalyzer
Hack93.BuildanApplicationShellwithEZApplicationGenerator
Hack94.LoadYourDatabasewithTestData
Hack95.UseAccessasanXMLDatabase
Chapter10.TheInternet
Section10.1.Hacks96100
Hack96.ExportaReportasHTML
Hack97.UseaBrowserInsideAccess
Hack98.PulltheHTMLSourceCodefromaWebSite
Hack99.DownloadFilesUsingtheWebBrowserControl
Hack100.UseaSmartTagtoOpenaWebPage
Colophon
Index


Credits
AbouttheAuthor
Contributors

Acknowledgments


AbouttheAuthor
KenBluttmanhasbeenhackingaroundwithAccessforyears.
HavinghonedhisprogrammingskillsbackwhenthePCwasjust
becomingahouseholditem,KenfoundAccessajoytouse,
evenbackinearlierversions.
BesidesAccess,KenexcelsatExcelandtheotherOffice
products,aswellasSQLServer,webdevelopment,and
VB/VB.NETdevelopment.Nowonderherarelysleeps.
KenisalsotheauthorofDevelopingMicrosoftOfficeSolutions
(AddisonWesley)andExcelFormulasandFunctionsfor
Dummies(Wiley),aswellasnumerousprintandweb-based
articles.
Onthepersonalside,Kenisamusicianandanaturelover.
Haveguitar,willtraveltothewoods.KenlivesinNewYorkwith
hiswife,son,dog,andseveralamphibians.
VisitKenathiswebsite:.


Contributors
Thefollowingpeoplecontributedtheirhacks,writing,and
inspirationtothisbook:
SteveConklinisanindependentsoftwaredeveloperandthe
ownerofUltraD.N.T.(Development,Networks,and
Training)TechnologyConsulting,locatedinQueens,New
York.HespecializesinAccess,VisualBasic/VB.NET,andMSSQLServerdevelopment,andisreleasingalineofPocketPC
applicationsforthemobileprofessional.Stevehaswritten
severalarticlesforAccess/VB/SQLAdvisormagazineandhe

teachesMicrosoftWindowsandOfficecoursesataNew
YorkCitycommunitycollege.Heisavailablefor
developmentworkandcanbereachedat

SteveHuffhasbeendevelopingAccessdatabase
applicationsformorethannineyears.Hehasacomputer
sciencedegreefromNorthernKentuckyUniversity,where
heistakingnightcoursestowardamaster'sdegreein
informationsystems.HehasbeendevelopingMicrosoft
OfficesolutionsasaconsultantworkingforSARCOMfor
morethansevenyears.StevelivesinKentuckywithhis
wife,Melissa.Youcanreachhimthroughhiswebsite:
.
KirkLambhasbeendabblingwithAccessformanyyears.
Althoughhisexpertiseisinboating,heknowsagood
databasewhenheseesone.Kirkliveswithhiswife,Dill,in
Washingtonstate.
AndreaMossfirstgotinvolvedwithAccesswhenshe
designedasystemtotrackinsuranceclaims.Sincethen,


shehasappliedherartisticskillstodesigninglayoutand
colorschemesforvariousGUIs,includingAccessformsand
websites.Alongtheway,shehaspickedupafewAccess
tricksofherown.
MichaelSchmalzworksinbankingandperformsbusiness
andtechnologyconsultinginavarietyofindustries.Hehas
beenatechnicaleditorforO'ReillyonMicrosoftOffice
books.MichaelhasadegreeinfinancefromPennState.He
liveswithhiswifeanddaughterinPennsylvania.

SimonSt.Laurentisawebdeveloper,networkadministrator,
computer-bookauthor,andXMLtroublemakerlivingin
Ithaca,NewYork.HisbooksincludeXML:APrimer,XML
ElementsofStyle,BuildingXMLApplications,Cookies,and
SharingBandwidth.Heisacontributingeditorto
XMLhack.comandanoccasionalcontributortoXML.com.
MargaretLevineYounghasusedsmallcomputerssincethe
1970s.ShegraduatedfromUnixonaPDP-11toAppleDOS
onanAppleIItoDOS,Windows,andUnixonavarietyof
machines.Shehasdoneallkindsofjobsthatinvolve
explainingtopeoplethatcomputersaren'tasmysteriousas
theymightthink,includingmanagingtheuseofPCsat
ColumbiaPictures,teachingscientistsandengineerswhat
computersaregoodfor,andwritingandcowritingcomputer
manualsandbooks,includingUnderstandingJavelinPLUS,
TheCompleteGuidetoPC-File,UNIXforDummies,andThe
InternetforDummies.Margyhasadegreeincomputer
sciencefromYaleUniversityandliveswithherhusbandand
twochildreninVermont.


Acknowledgments
Thisbookisacollaborativeeffort.Mythanksgotothe
contributorsforprovidinggreathacksthatIamsureyouwill
enjoyasmuchasIhave.
Specialthanksandappreciationgotomyeditor,MitchTulloch.
Mitchhasstuckwithmethroughthethickandthinofgetting
thisprojectcompleted.Hispatienceandperseverancehave
beenawesome.MitchwouldliketothankMTSCommunications
Inc.()forprovidingInternetservicesfor

hostinghiswebsite().
ThankstoMichaelSchmalzfortech-reviewingthematerialand
keepingonmybackaboutearlybindingversuslatebindingand
otherpertinenttopicsdeartoourprofession.
ThankstoBrianSawyerandthegreatO'Reillyteam.Thanksto
allofyou.
Thankstomyagent,NeilSalkind,andtheStudioBteam.Neil
calledmeonedaylastyeartoseeifIwouldbeinterestedin
writingAccessHacks.Ofcourse!Andthat'showImetMitch
Tulloch.
ThankstothestaffatDatabaseCreations,Inc.
()andFMS,Inc.
()forprovidingcopiesoftheir
outstandingproducts.
Lastbutnotleast,thankstomywifeGaylaandsonMatthew.
Workingonabookisalwaysstressful,andtheyhavebeenreal
troopersingivingmespaceandtimetocompletethebook.It's
cutetoseeaseven-year-oldbecomingsuchacomputerpro.
Often,MatthewwillsitonmylapandwatchwhatIamtyping.
NowheisanAccessexpertinhisownright.


Preface
Accessreallyisanamazingproduct.Itspowerisvast,andyet
itsmaintenanceislow.Infact,inmostinstallationsitsitson
thedesktopandismaintenance-free.It'sflexibleenoughtobe
usedbyonepersonortorunanentirecompany.It'sarapid
applicationdevelopment(RAD)toolthatoutshinesothersuch
tools(suchasVisualBasic)intimetodevelopmentandeaseof
use.

Accessisalsoacompletedatabaseapplicationsystem.It
incorporatesboththeback-endandfront-endelementsofa
database,therebyeliminatingtheneedtousetwoproductsto
getyourworkdone.Evenso,itsflexibilityallowsanAccess
databasefiletobejustabackendorjustafrontend.Access
cancontroldatainexternaldatabasesystemssuchasSQL
ServerandOracle.
NeedIsaymore?Idon'tthinkyouneedanyconvincingto
knowwhatagreatproductAccessis.Eitheryouareusingit
already,oryouareabouttostart.Well,hereissomegreat
news:thisbookisgoingtoshowyouevenmorewaystouse
Access.Whetherit'showtorunUnionqueries,playvideofilesin
Access,viewwebsiteswithinAccess,orevencontrolAccess
fromanotherproduct,therearehacksheretotickleevery
fancy.
AccessHacksletsyoumovebeyondthefamiliartables,forms,
andreportsparadigmandgetnewinsightsintomakingyour
databaseapplicationsmorevaluableandexciting.It'smy
pleasuretoshowyounewwaystoworkwithyourfavorite
databaseproduct.So,fireupyourcomputer,andlet'sget
started!


WhyAccessHacks?
Thetermhackinghasabadreputationinthepress.Theyuseit
torefertosomeonewhobreaksintosystemsorwreakshavoc
withcomputersastheirweapon.Amongpeoplewhowritecode,
though,thetermhackreferstoa"quick-and-dirty"solutiontoa
problem,oracleverwaytogetsomethingdone.Andtheterm
hackeristakenverymuchasacompliment,referringto

someoneasbeingcreative,havingthetechnicalchopstoget
thingsdone.TheHacksseriesisanattempttoreclaimthe
word,documentthegoodwayspeoplearehacking,andpass
thehackerethicofcreativeparticipationontotheuninitiated.
Seeinghowothersapproachsystemsandproblemsisoftenthe
quickestwaytolearnaboutanewtechnology.


HowtoUseThisBook
AccessHacksisnotmeanttobeasequentialread,althoughI
won'tcomplainifyoureaditstraightthrough,fromcoverto
cover!Thebookcontains100hacks,andeachstandsonits
ownmerit.Youcanreadtheminanyorder.Somehackshavea
commonthemewithotherhacks,inwhichcasetheflowisduly
noted.Otherthanthat,justdigin,andseewhatinterestsyou.
Onegroupofhacksmightbewhatyouneedfortoday'sproject,
andanothergroupmightbewhatyouneedtomorrow.


HowThisBookIsOrganized
EachchapterinAccessHackscentersonafacetofAccess.In
thisway,youcanfocusonareasinwhichyouneedalittle
inspiration.IfyouneedhelpwithqueriesandSQL,goto
Chapter5.Ifyouwanttolearnsomeprogrammingtricks,goto
Chapter8.Inparticular,hereiswhatyou'llfindineachchapter:

Chapter1,CoreAccess
Thefirstchaptercoversthebasics,fromorganizing
databaseobjectstoworkingwithdata.Inthischapter,
you'llfindnuggetsabouthelpingusers,overcomingversion

incompatibility,andevenhowtoworkwithanyamountof
data.

Chapter2,Tables
Tablesarethecoreobjectofanydatabase.Inthischapter,
you'llfindhacksthatshowyouhowtomovedatabetween
tablesandhowtoresetAutoNumberingtobeginwitha
numberofyourchoice.Also,youwilllearnwhatsystem
tablesareandhowtohavethemstayoutofyourway.

Chapter3,EntryandNavigation
Thischapterfocusesonusers'needs.Besidesstoringdata,
adatabasesystemneedstomakeiteasyforusersto
managethedata.Chapter3ischock-fullofhacksthat
improvehowusersworkwithforms,whichofcourseare
themostcommondatabaseobjectsusersinteractwith.


Chapter4,Presentation
Oncedataisenteredandstored,therestoftheequation
involvesreporting.Thischaptershowsyounewwaysto
workwithreports.Learnhowtouseawatermark,provide
sophisticatedsorting,andprovideconditionaltotals.Don't
forgettocheckthehacksoncreatingaslideshowand
playingvideos!

Chapter5,QueriesandSQL
Runningqueriesisabigpartofdatabasework.Manyofthe
hacksinthischaptertakeyoubeyondthebasicsofthe
querydesigngrid.ImmerseyourselfintheSQLlanguage

itselfasyoudiscoverUnionqueries,usingtheInandNot
operators,andhowtousecustomfunctionsinqueries.
Thereisevenahackthatencouragesyoutoquery
unrelatedtablestoreturnallcombinationsofdataintwo
fields.

Chapter6,MultiuserIssues
Certainissuesexistonlyinasharedenvironment.Inthis
chapter,you'llfindhacksthatprovideworkaroundsfor
commonproblems.Learnhowtoendanunattendededit
andhowtodistributeadatabasewithnohassles.

Chapter7,ExternalProgramsandData
Accessiseasytointegratewithotherprogramsand
protocols.ThischaptershowsyoumanywaystouseAccess


withotherproducts,includingExcel,Word,MySQL,andSQL
Server.IfyouhaveaninklingofhowtoworkwithXML
data,thischapterincludeshacksforthat.Thereisevena
hackthatshowsyouhowtocreateAccesstableswithout
runningAccess.

Chapter8,Programming
Thischapterprovidesanumberofprogramming
techniques.Itincludeshacksforoptimizingcode,writing
fastercode,andprotectingcode.Otherhacksprovide
minisolutions,suchasawaytodrilldowntoaspecific
recordandtoprovidefeedbackduringalongprocess.


Chapter9,Third-PartyApplications
Thischapterpreviewsafewthird-partyproductsthatmake
yourdatabaseworkabreeze.Learnaboutproductsthat
createadatabaseframework,documentyourdatabase,and
evenprovidedata.Lastbutnotleast,thischapterprovides
anoverviewofacompleteXML-basedapplicationsolution.

Chapter10,TheInternet
ThehacksinthischaptershowyouhowtocreateHTMLfiles
fromAccess.WithjustalittleeditingwithanHTMLtoolor
inatexteditoryoucanturnanAccessreportintothe
formatyouneed.You'llfindhacksinthischapterforputting
awebbrowserdirectlyonanAccessform.Needtocheck
youronlineinvestments?Youcandosowithoutleavingthe
database.


ConventionsUsedinThisBook
Thefollowingisalistofthetypographicalconventionsusedin
thisbook:

Plaintext
Indicatesoptions,queries,andoptionsenteredusing
Access'sgraphicaluserinterface(GUI),includingtable
titles,cellidentifiers,namedranges,menutitles,menu
options,menubuttons,andkeyboardaccelerators(suchas
AltandCtrl).

Italics
IndicatesURLs,filenames,filenameextensions,and

directory/foldernames.Forexample,apathinthe
filesystemappearsas/Developer/Applications.

Constantwidth
Showscodeexamples,thecontentsoffiles,consoleoutput,
aswellasthenamesofvariables,commands,functions,
macros,statements,command-linequeries,andothercode
excerpts.

Constantwidthbold

Highlightsportionsofcode,typicallynewadditionstoold
code.


Constantwidthitalic
Usedincodeexamplesandtablestoshowsampletextto
bereplacedwithyourownvalues.

Color
Thesecondcolorindicatesacrossreferencewithinthetext.
Youshouldpayspecialattentiontonotessetapartfromthe
textwiththefollowingicons:

Thisisatip,suggestion,orgeneralnote.Itcontainsuseful
supplementaryinformationaboutthetopicathand.

Thisisawarningornoteofcaution,oftenindicatingthatyourmoney
oryourprivacymightbeatrisk.


Thethermometericons,foundnexttoeachhack,indicatethe
relativecomplexityofthehack:
beginner moderate expert


UsingCodeExamples
Thisbookisheretohelpyougetyourjobdone.Ingeneral,you
canusethecodeinthisbookinyourprogramsand
documentation.Youdonotneedtocontactusforpermission
unlessyou'rereproducingasignificantportionofthecode.For
example,writingaprogramthatusesseveralchunksofcode
fromthisbookdoesnotrequirepermission.Sellingor
distributingaCD-ROMofexamplesfromO'Reillybooksdoes
requirepermission.Answeringaquestionbycitingthisbook
andquotingexamplecodedoesnotrequirepermission.
Incorporatingasignificantamountofexamplecodefromthis
bookintoyourproduct'sdocumentationdoesrequire
permission.
Weappreciate,butdonotrequire,attribution.Anattribution
usuallyincludesthetitle,author,publisher,andISBN.For
example:"AccessHacksbyKenBluttman.Copyright2005
O'ReillyMedia,Inc.,0-596-00924-0."
Ifyoufeelyouruseofcodeexamplesfallsoutsidefairuseor
thepermissiongivenhere,feelfreetocontactusat



SafariEnabled

WhenyouseeaSafari®Enabledicononthecoverof

yourfavoritetechnologybook,thatmeansthebookisavailable
onlinethroughtheO'ReillyNetworkSafariBookshelf.
Safarioffersasolutionthat'sbetterthane-books.It'savirtual
librarythatletsyoueasilysearchthousandsoftoptechbooks,
cutandpastecodesamples,downloadchapters,andfindquick
answerswhenyouneedthemostaccurate,currentinformation.
Tryitforfreeat.


HowtoContactUs
Wehavetestedandverifiedtheinformationinthisbooktothe
bestofourability,butyoumightfindthatfeatureshave
changed(oreventhatwehavemademistakes!).Asareaderof
thisbook,youcanhelpusimprovefutureeditionsbysending
usyourfeedback.Pleaseletusknowaboutanyerrors,
inaccuracies,bugs,misleadingorconfusingstatements,and
typosthatyoufindanywhereinthisbook.
Pleasealsoletusknowwhatwecandotomakethisbookmore
usefultoyou.Wetakeyourcommentsseriouslyandwilltryto
incorporatereasonablesuggestionsintofutureeditions.Youcan
writetousat:
O'ReillyMedia,Inc.
1005GravensteinHwyN.
Sebastopol,CA95472
(800)998-9938(intheU.S.orCanada)
(707)829-0515(international/local)
(707)829-0104(fax)
Toasktechnicalquestionsortocommentonthebook,send
emailto:


ThewebsiteforAccessHackslistsexamples,errata,andplans
forfutureeditions.Youcanfindthispageat:
/>Formoreinformationaboutthisbookandothers,seethe
O'Reillywebsite:



GotaHack?
ToexploreHacksbooksonlineortocontributeahackforfuture
titles,visit:



1.CoreAccess
Section1.1.Hacks112
Hack1.HelpUsersFindtheObjectsTheyNeed
Hack2.PersonalizeYourAccessApplication
Hack3.WorkFastandAvoidTypos
Hack4.OptimizeDataChanges
Hack5.TransferDataBetweenVersionsofAccess
Hack6.OrganizeandEnhanceYourMacros
Hack7.RidYourDatabaseofClutter
Hack8.ProtectValuableInformation
Hack9.WorkwithAnyAmountofData
Hack10.FindDatabaseObjectsinaSnap
Hack11.UseaJunctionTable
Hack12.StoptheDatabasefromGrowing


1.1.Hacks112

Accessisusedinmanydifferentsituations,inmanydifferent
ways,byadiversegroupofpeople.Somearenovices,while
othershavebeenusingasinglecustomAccesssolutionfor
years.Stillothersaresophisticateduserswhowanttotake
advantageoftheapplication'sbellsandwhistles,ortheyare
Accessdeveloperswhomakethosebellsandwhistlesringand
sing.
OnethingallusersanddeveloperswantisforAccesstosupport
theirneedsasefficientlyaspossible.Thiscanrequirealittle
customizationoradown-rightminisolutionthat'simplemented
insideAccessandhelpstosupportthepurposeoftheoverall
solution.
Thischapterincludesacollectionofhacksyoucanimplement
directlywithinAccess.You'llfindhacksdesignedtohelpgeneral
usersbymakingtheirexperiencemorerewardingandmore
efficient.You'llalsofindhacksapowerusercanimplementto
expandthevalueofhiscustomAccessapplication.You'lleven
findhacksthatonlyadevelopercanimplement.AlittleVBA
goesalongwayhere.


Hack1.HelpUsersFindtheObjectsTheyNeed

Placeshortcutstopertinentobjectsincustomgroupsso
thatusersdon'thavetowadethroughallthedatabase
objects.
TheAccessdatabasewindowcanbeoverwhelmingtosome
users.Tables,queries,forms,reports;determiningwhereto
findobjectsyouneedwithintheseobjectcollectionsisn't
exactlyauser-friendlyprocess.Besides,sometimesauser

needsjustahandfulofobjectstocompletehiswork.Andyet
hemightbeconfrontedwithconsiderablymoreobjectsthanhe
needs.
Luckily,theAccessdatabasewindowallowsyoutocreate
customgroupingsinwhichyoucanplaceshortcutstoonlythe
desiredobjects.JustastheWindowsdesktophasshortcutsto
folders,files,andapplications,Accessletsyoumakeshortcuts
toyourdatabaseobjects.Andit'sacakewalktodoso!

1.2.1.ThePlainDatabaseWindow
YourAccessapplicationmightopentoanavigation,ormain,
form.Fromthere,usersclicktheirwaythroughtheapplication.
Butnotallapplicationsaremadeinthisway.Figure1-1shows
theplaindatabasewindowinallitsunimpressiveglory.Some
applicationsopentothisfunctionalbutinefficientwindow.

Figure1-1.ThestandardAccessdatabasewindow


×