Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[blue] If Me.NewRecord Or Not Me!LockEdit Then
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If[/blue]
[blue]Public Sub SavRec()
DoCmd.RunCommand acCmdSaveRecord
End Sub[/blue]
[blue]Public Function tglEdit()
If IsOpenFrm("[purple][b]MainFormName[/b][/purple]") Then
Dim frm As Form
Set frm = Forms![purple][b]MainFormName[/b][/purple]
[green][b]'Add the following line only if controlling subForm:[/b][/green]
Set frm = frm![purple][b]SubFormName[/b][/purple].Form
If Not frm.NewRecord Then
If frm!LockEdit Then
frm.AllowEdits = True
frm!LockEdit = False
Call frm.SavRec
Else
frm!LockEdit = True
Call frm.SavRec
frm.AllowEdits = False
End If
End If
End If
End Function
Function IsOpenFrm(frmName As String) As Boolean
Dim cp As CurrentProject, Frms As Object
Set cp = CurrentProject()
Set Frms = cp.AllForms
If Frms.Item(frmName).IsLoaded Then
If Forms(frmName).CurrentView > 0 Then IsOpenFrm = True
End If
Set Frms = Nothing
Set cp = Nothing
End Function
[/blue]
[blue]Call tglEdit[/blue]
Macro Name Action Function Name
---------- --------- -------------
^L RunCode tglEdit()
StopMacro
So . . . imagine a [blue]Continuous Form[/blue] where the textboxes of locked records have a [highlight]light yellow background[/highlight] or the text is in bold or both![blue]Conditional Formatting is a means of assigning individual control of a textbox for each record via some criteria. The best part is that no VBA is required.[/blue]
[blue] Dim Msg As String, Style As Integer
Dim Title As String, FolderSpec As String, fs As Object
Set fs = CreateObject("Scripting.FileSystemObject")
FolderSpec = "[purple][b]C:\Windows\TheAceMan1[/b][/purple]"
If fs.FolderExists(FolderSpec) Then
Msg = "Folder '" & FolderSpec & "' already exist!"
Style = vbInformation + vbOKOnly
Title = "Folder Exist Notice! . . . ."
MsgBox Msg, Style, Title
Else
fs.createfolder (FolderSpec)
End If
Set fs = Nothing[/blue]