OK Thurls . . . . .
Add the following code to a module in your module window:
Code:
[blue]Public Sub SaveProps(frmName As String)
[green]'Note: If frmName is a subForm you have to use
'the main form Name instead![/green]
Dim frm As Form
Application.Echo False [green]'Stop updating screen[/green]
DoCmd.OpenForm frmName, acDesign
Set frm = Forms(frmName)
[green]'Your property changes here[/green]
frm!CheckID.Visible = False
'
'
DoCmd.Close acForm, frmName, acSaveYes
DoCmd.OpenForm frmName
Application.Echo True [green]'Allow screen updates[/green]
End Sub
Public Function RestoreEchoHG()
DoCmd.Hourglass False
Application.Echo True
Msg = "Application Echo is on!"
Style = vbInformation + vbExclamation + vbOKOnly
Title = "Forced Echo On!"
MsgBox Msg, Style, Title
End Function[/blue]
In the click event of your button add the following call:
Code:
[blue] [green]'Note: If frmName is a subForm you have to use
'the main form Name instead![/green]
Call SaveProps(frmName As String)[/blue]
Now . . . . there's an issue with [blue]Application.Echo False[/blue]. If for any reason the code locks-up or there's an error while screen updating is off, you won't be able to do anything. It will appear as if you can do nothing. So ya need to setup a hotkey for safety. This puts everything back to normal. You should never have to use it, but . . . . you never know. Besides, without the Echo, the switching back & forth between design and form view is ugly! To see it for yourself just disable the Application.Echo False line and you'll see what I mean.
1) In the macros window open a new macro.
2) In The [blue]Macro Name[/blue] column enter [purple]
^E[/purple] (this sets the hotkey to Ctrl + E).
3) In the [blue]Action[/blue] column select [purple]
RunCode[/purple].
4) In the [blue]Function Name[/blue] at the bottom enter [purple]
RestoreEchoHG()[/purple].
5) In the next action line select [purple]
StopMacro[/purple].
6) Close the macro window and be sure to save it as [purple]
AutoKeys[/purple].
7) Test it by hitting Ctrl + E.
Thats it! . . . . Give it a whirl and let me know . . . .
See Ya! . . . . . .