Sunday, July 29, 2007

To Save or Not to Save Records

Sometimes people like to know when a record has been changed before closing a form
This function will help you in that regard

Public Function ConfirmRecordChanges() As Boolean

'Confirm record changes

Dim intSaveChanges As Integer
On Error Resume Next
ConfirmRecordChanges = False
If Forms(CurrentObjectName).Dirty Then

intSaveChanges = MsgBox("Do you want to save the changes?", vbYesNo, "This Record has been modified")
If intSaveChanges = vbYes Then
On Error GoTo errHandler
RunCommand acCmdSaveRecord
ConfirmRecordChanges = True
RunCommand acCmdUndo
End If
ConfirmRecordChanges = True

End If

Exit Function

MsgBox "Error number: " & Err.Number & vbCrLf & vbCrLf & Err.Description, vbExclamation, "Problem Saving Record"

End Function

Friday, July 27, 2007

Making a Tab Control Page visible

If you want to make a page in tab control visible, use the following code.

Dim tabCtl As TabControl, ctl As Control
Set tabCtl = Forms!YourFormName!tabCtrls '~Your tabcontrol that holds the pages

For Each ctl In tabCtl
If ctl.Name = "pgeIdentifier" Then
ctl.Visible = True
End If

Next ctl
Set tabCtl = Nothing

Wednesday, July 25, 2007

Folder Listing

Its a really old trick but if you want a listing of a folder, open MSDos window by typing cmd into the Windows run box. Now cd to the folder that you want to list i.e.

cd c:\projFolder

Now type

dir/b > list.txt

Default values for combo boxes

Did you know that you can make the first row of data in a combo box, the default value for that combo box? Open the form that the combo box is on in design mode and select properties. Find the default value property and type the following into the default value.


Please replace the name of your combo box with [cboCustomer]. Leave the term [itemData] as is

Monday, July 23, 2007

DataModel.Org ~ A place to find out about data modelling

Scott McManus writes

This website provides a good overview and introduction to the Mystical world of datamodeling, symbology and cardinality. It explains the reasons why we would want to normalise our data and the levels of normalisation and what they do in simply easy to understand language and has some good diagrams that would normally be used in an Entity Relationship Diagram. It is not a pretty web site and has not been updated often. But then the topic is fairly static, it also provides a list of relevant texts one can source that will further explain Normalisation. I like this introductory book on Database management with a bonus that it uses MS access as its explanation tool.

DataModel.Org Home Page

Click for book

Saturday, July 21, 2007

The runtime download is available for FREE!

On this page you will find out more about the free runtime kit and developer extensions for Access 2007.

Note: If you are intending on using the runtime kit, think about your target market.

If your target market is running Office 2007, but not Access this is a good approach. If your target is not running anything Office, it should be good.

If your target market is using older versions of Access or Office, you will need to do a lot of testing or at least be on your customers computer so that you can wind back the install if it wrecks your customers older versions.

Clint Covington: Software design, Microsoft Office Access : The runtime download is available for FREE!