- Local time
- Today, 04:32
- Joined
- Jul 9, 2003
- Messages
- 16,893
How does the quick search work?
Private Sub QuickSearch_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Claim #] = " & str(Me![QuickSearch])
Me.Bookmark = rs.Bookmark
Me.txtSSN = Me.QuickSearch.Column(1)
End Sub
Private Sub QuickSearch_AfterUpdate()
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Claim #] = " & str(Me![QuickSearch])
Me.Bookmark = rs.Bookmark
'Me.txtSSN = Me.QuickSearch.Column(1)
End Sub
Function fGetWinUserName()
fGetWinUserName = VBA.Environ("UserName")
End Function ' fGetWinUserName
Function fGetComputerName()
fGetComputerName = VBA.Environ("COMPUTERNAME")
End Function ' fGetComputerName
Dim MyForm As Form
Dim ctl As Control
Dim sUser As String
Set MyForm = Screen.ActiveForm
' sUser = "User: " & UsersID 'You need to identify your users if you are not using Access security with workgroups.
sUser = CurrentUser
Dim MyForm As Form
Dim ctl As Control
Dim sUser As String
Set MyForm = Screen.ActiveForm
sUser = [B]Environ("currentuser")[/B]
Try these:
Code:Function fGetWinUserName() fGetWinUserName = VBA.Environ("UserName") End Function ' fGetWinUserName Function fGetComputerName() fGetComputerName = VBA.Environ("COMPUTERNAME") End Function ' fGetComputerName
Note: can use Environ("UserName") or Environ("COMPUTERNAME") but not for all access versions.
I may be off here, but should it not be:Call AuditTrail(Me)
Private Sub AddAuditTrailField()
Dim db As DAO.Database
Dim tbl As DAO.TableDef
Dim fld As DAO.Field
Dim SkipTable As Boolean
Const SystemObject As String = "MSys"
Set db = CurrentDb
For Each tbl In db.TableDefs
SkipTable = False
If SystemObject <> Left(tbl.Name, 4) Then
For Each fld In tbl.Fields
If fld.Name = "MemAuditTrail" Then
SkipTable = True
End If
Next fld
If Not SkipTable Then
Set fld = tbl.CreateField("MemAuditTrail", dbMemo)
tbl.Fields.Append fld
End If
End If
Next tbl
Set fld = Nothing
Set tbl = Nothing
Set db = Nothing
End Sub