Microsoft Office

PowerPoint

This template conforms to the graphics standards of the company. It contains slides for all types of content.

Word

My job was to turn a number of Word documents into a clear and concise manual for employees.
How-to's

Table of contents

Go to References - Table of Contents - Insert table of contents. If you've created your own heading styles, go to Options and delete the letters 1, 2 and 3 under TOC Level. Find your main heading style (e.g. MyHeading) and set it to 1. Subheadings should then be set to 2, 3 etc. You can modify the look now by pressing Modify, or anytime by finding TOC 1, TOC 2 etc. under Styles.

Mark start of chapter

Insert a section break before each chapter by going to Page Layout - Breaks - Section Breaks - Next Page. You can now customize the first page by ticking Different first page under Header & Footer Tools.

Current chapter title in footer

Place the cursor where you want the title to appear. Go to Insert - Quick Parts - Field - Categories: Links and References - Field names: StyleRef. Under AutoText name, select your main heading style.

Positioning

Word can be unpredictable when it comes to object placement. Double click on your image or shape to jump to Drawing tools - Format. Go to Position - More layout options. For a center-top placement, choose Horizontal - Alignment Centered, relative to Page and Vertical - Alignment Top, relative to Page.

Access

This database consists of two linked tables which hold client information and client orders. I chose to create two sets of forms: one with a clean interface and custom prompts to prevent unwanted changes to the data, and another one with keyboard shortcuts and minimal interference. The main form has hyperlinks to all forms and reports, while the navigation pane is closed and tables are hidden by default.
How-to's
  1. Jump to new record
  2. Confirm changes
  3. Keyboard navigation
  4. Combobox
  5. Custom error message

Jump to new record

Private Sub Form_Load()

DoCmd.GoToRecord , , acNewRec

End Sub

Confirm changes

Show a prompt only when modifying an existing record. This is the first and only piece of code in the module, so I've included the lines Option Compare Database and Option Explicit. They should be included only once per module. All prompts and error messages are in Finnish because I'm too lazy to translate them.

Option Compare Database
Option Explicit

Private Sub Form_BeforeUpdate(Cancel As Integer)

Dim vastaus As VbMsgBoxResult

If Me.NewRecord = False Then
	vastaus = MsgBox("Haluatko varmasti muokata asiakastietoja", vbOKCancel, "Muutosten tallennus")

	If vastaus = vbOK Then
		DoCmd.Save
	Else
		DoCmd.RunCommand acCmdUndo
	End If

End If

End Sub

Show a different prompt when modifying an existing record and when adding a new record.

Private Sub Form_BeforeUpdate(Cancel As Integer)

Dim vastaus As VbMsgBoxResult
Dim viesti As String

If Form.NewRecord = True Then
	viesti = "Haluatko varmasti lisätä asiakkaan rekisteriin?"
Else
	viesti = "Haluatko varmasti muokata asiakastietoja?"
End If

vastaus = MsgBox(viesti, vbYesNo, "Tietojen muokkaus")

If vastaus = vbYes Then
	DoCmd.Save
	Me.selite_viesti.Visible = True
Else
	DoCmd.RunCommand acCmdUndo
End If

End Sub

Keyboard navigation

Set focus to the subform (Tilauslista alilomake) on F4.

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyF4 Then
	Me.Tilauslista_alilomake.SetFocus
End If

End Sub

Set focus to the main form (Tilauslista) combobox (asiakashaku) on F3, jump to new record on F4.

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyF3 Then
	Forms!Tilauslista.asiakashaku.SetFocus

ElseIf KeyCode = vbKeyF4 Then
	DoCmd.GoToRecord , , acNewRec
	
End If

End Sub

Combobox

Highlight text and expand the combobox when it gains focus.

Private Sub asiakashaku_GotFocus()

Me.asiakashaku.SelStart = 0
Me.asiakashaku.SelLength = Len(Me.asiakashaku.Text)
Me.asiakashaku.Dropdown

End Sub

Custom error message

Bypass the default error message and show a custom message when a match is not found for whatever is typed in the combobox. It's especially useful for helping users find what they're looking for. The error message will show twice if the data isn't cleared or the subroutine isn't exited properly.

Private Sub asiakashaku_NotInList(NewData As String, Response As Integer)

Response = acDataErrContinue

If NewData = "" Then
	Exit Sub
Else
	Me.asiakashaku.Value = ""
	MsgBox ("Hakusanaa '" & NewData & "' vastaavaa asiakasta ei löytynyt." & vbCr & vbCr & "Kirjoita yrityksen virallinen nimi (esim. Oy Yritys Ab tai Asunto Oy Yritys). Kirjoita henkilöasiakkaan etunimi ensin.")
	Exit Sub
End If

End Sub

Comments