Howdy,
I am working on a project that includes a BE file, and two FE files. One FE is a control panel for the admins to adjust security settings, look at audit files, etc., while the other FE serves as the data entry point for lower level users.
Right now, when a admin creates a new employee in the FE Control Panel, it creates an audit table in the BE, then links it to back the FE Control Panel.
What do I need to do to also link the new table to FE Data Entry using VBA?
Here is a code snippet of what I am using now:
I am working on a project that includes a BE file, and two FE files. One FE is a control panel for the admins to adjust security settings, look at audit files, etc., while the other FE serves as the data entry point for lower level users.
Right now, when a admin creates a new employee in the FE Control Panel, it creates an audit table in the BE, then links it to back the FE Control Panel.
What do I need to do to also link the new table to FE Data Entry using VBA?
Here is a code snippet of what I am using now:
Code:
Dim db As Database
Dim td As TableDef
Dim fd As Field
Dim stFile As String
Dim TableName As String
'Create new employee's audit file in the System Log and link.
stFile = "C:\System Project\SystemLog.accdb"
Set db = OpenDatabase(stFile)
TableName = "tblEmployees_" & Me.txtUserID
Set td = db.CreateTableDef(TableName)
td.Fields.Append td.CreateField("dtmTimeStamp", dbDate)
td.Fields.Append td.CreateField("chrComputer", dbText, 100)
td.Fields.Append td.CreateField("memAction", dbMemo)
db.TableDefs.Append td
db.TableDefs(TableName).Fields("dtmTimeStamp").DefaultValue = "Now()"
DoCmd.TransferDatabase acLink, "Microsoft Access", stFile, acTable, _
TableName, TableName
DoCmd.Close acForm, Me.Name, acSaveYes
MsgBox "New Employee Creation Successful!", vbOKOnly, "Congratulations"
Exit Sub