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.
WHERE
= '+999'
AND
= '+999'
Sub Form_Open(Cancel As Integer)
Const Foo = "bar" <--- existing code may be here
Dim Bar As Integer <---
<--- insert new code here
On Error GoTo Hades <--- more existing code here
End Sub
Const ReplString = "+999"
Dim intInsPt As Integer, strUserMatch As Variant
intInsPt = InStr(Me.RecordSource, ReplString)
If intInsPt = 0 Then
' Oops! SQL template has no ReplString in it!
Beep
MsgBox "Form Record Source error. Notify programmer.", vbExclamation
Cancel = True
Exit Sub
End If
strUserMatch = DLookup("
", _
"UserInfo", "UserName='" & CurrentUser() & "'")
If IsNull(strUserMatch) Then
' Oops! No match for user in UserInfo table
Beep
MsgBox "No permission found for " & CurrentUser() _
& ". Notify programmer.", vbExclamation
Cancel = True
Exit Sub
End If
' Now modify the form record source to select
' records for this user only
Me.RecordSource = Left$(Me.RecordSource, intInsPt - 1) _
& strUserMatch _
& Mid$(Me.RecordSource, intInsPt + Len(ReplString))