Set Control Defaults
acCmdSetControlDefaults
Add the following code to a module. Now add a button to a toolbar and set its action to =SetDefault()
'***************** Code Start *******************
'This code was originally written by Terry Wickenden.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
Function SetDefault()
On Error GoTo ErrSetDefault
DoCmd.RunCommand acCmdSetControlDefaults
Exit Function
ErrSetDefault:
Select Case Err
Case 2046
'Command not available
MsgBox "Set default is not available at this time." & _
"Please ensure that you have selected a control.", & _
vbCritical, "Not Available"
Case Else
MsgBox Err.Number & ":-" & vbCrLf & Err.Description
End Select
End Function
'****************** Code End ********************