I am trying to create a simple audit trail (which I got directions online) in my Database (and have posted a copy here) but am getting an error on the second form (and this will be a subform eventually) -The Audit Trail instructions say to put four fields in my table which feeds the form - CreateBy=Text, CreateDate=Date/Time and default to =now(), ModBy=text, and ModDate=Date/Time.
Then to add code to the Current and BeforeUpdate events on the form as you will see in my forms attached. I created a test database with very little data (called AuditTrackingTest2DBLp-attached). I created the first table (tblCustomers) and then created the form (FormCustomerInput) and then I added code to this form on the Current and BeforeUpdate as I was instructed in my notes and it recorded my changes perfectly in the tblCustomers.
I then created a new table called tblCustomerOrders and then a form (FormCustomerSubOrders) based on this table and added the same code to this form and it is giving me an error message in the code Compile Error: Variable not defined.
I have the need to put a separate image per ID on my table/form or a separate link to an image I can put an image on my form but its does not change when I change my clients its the sam e all the time, I have tried linking to an excel book but for some reason it will only show 10 fields, (and it is linked).
I don't mind creating a standard windows folder with my images in but would need to be able to link to each one from my form.
I am trying to create a database for a company I work with which creates a food product which needs to be traceable from creation to finish. I have created a table with all of the necessary information for the creation of a batch.
1. During this batch creation, we add water multiple times which we record each time, i.e., 2cups, 2 cups, 2cups, etc. I have a field for "water", and wish to record each instance and amount of water added, but only want one record for the complete batch. Also I only need the total water amount in the batch record, but want to be able to expand to see the individual amounts as needed.
2. Also, we need to record various readings (temp, etc.) throughout batch creation. Again, same problem as before.
What is the best way to do this? I want to be able to reference this info anytime I want to check creation specs for each individual batch.
I have a form where a user can change the scheduled start date for a job. On a sub form on the same screen is a list of notes relating to that job.
Any notes added, automatically have todays date and are locked when the user clicks off.
When the scheduled start date is changed I need a note to be made. Either forced, then entered by the user or automatically.
I was thinking of making the scheduled start appear in a small form and the button to make it come up could add a new note on the click event (possibly in a message).
Or even better (probably harder) any time the value is changed in the form a new note is added.
Other options could be a pop up form to add one note on a change.
Whenever I create a combobox, Access asks me if I want to grab the values from another table, or if I just want to manually input the possible values.
My question is: is one of the two solutions "better" than the other?
Let's imagine I am creating a Form where I can create a new Contact, and in a listbox (with multiple selections allowed) I want to list the possible character traits, so I have
I think that if I need to store in the Contact records these possible traits, I will have to create a Many-to-Many relationship (therefor creating a junction table) between Contact and Traits.
On the other hand, could I do everything without grabbing values from an extra table and directly inputting the values in the listbox? How would these elements be stored in the Contact record if I allow multiple values in one single field?
I have a form, frmSub, that contains the combo box comProducts. I also have two tables, Products and PurchaseDetail. Both tables have the field ProductID.
I want comProducts to create a new record in the Products table, using the input in a field called Product and then to use the value of ProductID to create a new record in the PurchaseDetail table. Ie, so the PurchaseDetail table has a record that links to another record in the Products table via the feild ProductID.
I have the requirement to write EACH record from a table to its own CSV file with name of the file being combination of 2 fields
So let's say I have Table1 with 3 columns (Field1, Field2, Field3) with following content :
Field1 Field2 Field3 AA 1 ABC AA 2 DEF AA 3 GHI
I should get 3 files with names AA1.CSV, AA2.CSV and AA3.CSV and each file contains its respective row from the table.
I tried to do it with DAO Recordset, but I do not find a way to write only the current record from recordset while looping.
See below the code I was using, but issue is that code does succesfull creates the 3 CSV files as per above example, but in each file it writes ALL 3 ROWS instead only the respective ROW.
Code: Dim db As DAO.Database Dim rs As DAO.Recordset Dim strSQL As String Dim strFilename As String
I have imported an Excel table with a column which has several values in one cell separated by "". In my case names of institutions afiliated with a patent. Example of the format of a single cell: MASSACHUSETTS INSTITUTE OF TECHNOLOGY (US) RIVE TECHNOLOGY INC (US)
In order to normalize the Access database I would like to extract the institutions to a separate table (institutions) and that the patent is related to both institutions.
I have two tables, one with a list of accounts (ACC), the other to post data about the accounts (DATA). I created a form for DATA and a combo box to select the account it relates to.
In the DATA split form, the account name shows up correctly in the datasheet. But when I select the DATA table, the ID of the account name shows up instead. How do I get the table to look the same as the datasheet in the split form?
I have a database that is used to allocate appointments to our staff. It has 2 tables, one that lists the clients we need to call in that day, and another that stores details of each contact attempt. I'd like to design a query that find all clients who we have not dealt with so we can easily get their details in a list. I know what the criteria for the query would be, but I'm stuck for how to actually execute it. Here are the details.
Table tClients stores the current clients - primary key is named "clientRef" Table tContactEvents stores each contact attempt and the date/time is stored in a field named "dateTime".
When an entry has been dealt with successfully a yes/no field named "completed" will be set to "Yes".
There may be many attempts to contact a specific client on a given day, unsuccessful attempts will not have the completed flag set.
Once the completed flag is set that client will be ignored so no further entries will appear.
So I need a query that searches tContactEvents for the most recent match to each number in tClients.clientRef and checks if the completed flag is set. If the completed flag is false, or if the number has no match (i.e. no contact attempts made yet) then the clientRef should be displayed. I also need this to be restricted to the current date, as the same client could have rebooked their appointment to a different day.
Is their a way to create a audit log in access?I have a log-in screen on my db and every time a user logs in i want it to be recorded. is their away to do it?
I have a form with a few tabs and 3 subforms. I used the following Audit Trail [URL] .... to complete what I have so far and it's been really great. Simple, easy to use and works well. The only issue that I have is it doesn't read the edits from the sub forms. It tells me when a new record is created or deleted but I can't see if anything was changed or what was input into the new record.
I believe it's something to do with Screen.ActiveForm but I can't be certain.
Below is the code that I use in a module and the code on the event section of the forms and the module that I use. Also all the controls I want audited have Audit in the tag of the Other menu.
BadAudit Module
Sub AuditChanges(IDField As String, UserAction As String) On Error GoTo AuditChanges_Err Dim cnn As ADODB.Connection Dim rst As ADODB.Recordset Dim ctl As Control
[Code] ....
The After Del and Before Up are also on the forms SuspensionsSubFrm, ReviewsSubFrm and Framework which are all subforms.
I have been using Access for quite some time now and I am able to usually work around many of the issues that come with being a small timer, like me, taking his best shot at Access; however one issue I have had absolutely no luck with is auditing a new and/or change made to an "Attachment Field". I have successfully been able to audit every type of field with the exception of the "Attachment Field".
I am trying to record the current windows username in an audit field. But all i can get is the Username Admin?
Dim MyForm As Form, C As Control, xName As String Set MyForm = Screen.ActiveForm 'Set date and current user if form has been updated. MyForm!Audit = MyForm!Audit & Chr(13) & Chr(10) & _ "Changes made on " & Now & Date & " by " & CurrentUser() & ";"
After a lot of reading and consolidating VBA codes for audit trail.How My Audit Trail Works..A module was made for a function named as "Changes" .Then inserted into before update event of a form where I will do the editing of the records.Then I made a table named as Audit.Inside this table I made all the fields I needed such as:
*AuditRecordId[autonumbered] *FormName[The name of the form for editing] *Index[The record ID of the record being edited] *ControlName[The Field being edited] *DateChanged[Date change was done] *TimeChanged[Time change was done] *PriorInfo[for the old value of data being changed] *NewInfo[For the new value of data changed] *CurrentUser[The user base on log in form that was set to Global into another module] *Reason[The reason for changing for future references]
And Here is the Function Code:
Code:
Option Compare Database Option Explicit Function Changes() Dim db As Database Dim rs As Recordset Dim strSQL As String Dim strCtl As String Dim strReason As String
[code]....
This audit trail function is valid only for one(1) form, due to the limitation of
Code: Screen.ActiveForm.Controls("SUP ID").Value
where "SUP ID" is the primary key of the record being updated/Change, so if there are Five(5) tables that needs audit trail, there will be also Five(5) forms, as well as Five(5) Function Changes namely; Changes(), Changes1(),Changes2(),etc... because all the table do have their own sets of primary Key.
Is there a shortcut, in such a way that the "rs!Index" will automatically return a value, equivalent to the Primary Key/Record Id of the record being updated/change, given that there are different updating forms for each table to be updated?
I've always used an audit trail for tracking changes of records that already exist but I have had a situation come up where I now need to track records that have been deleted. For example, if I delete a record in the datasheet view.
I've seen several examples how to do this, with the most common seeming to store the data into a temporary table while waiting for the delete confirmation. If I am reading the notes correctly, it's done this way to capture occurrences when multiple records are selected to be deleted. Is this the best approach for this type of task?
i have an application with an audit trail module, i do read the table name , field name,old value, new value. but the lables of the fields at my forms are changed to arabic language
for example
lets say i do have a table the name of one field is Name on the form the label of this field is Lawyer Name
now the client is asking me to show the ( Lawyer Name ) not the field name ( Name ) in the audit trail to know the changes were made.
I thought to go to the tables and on each field 's caption i shall add in arabic the same as in my form
I am trying to read the caption of the field from the tables
i hope you understood what i mean
if you show me the code to do that , it would be highly appreciated
I would like to separate my list box in two categories.Indeed it is composed by 2 types of criteria but arranged in the same List box (I can't create another List box, it's forbidden).how can I proceed?I've thought to insert a dash but it has to appear all the time and I don't know if it's possible to do that.
I've also thought to enter a title IN the list box above each category but it has to appear all the time too..when I click on one item in the List box it becomes highlight.May be code the 2 titles I could add for being always selected (highlight).I don't want to have to select the 2 titles every time!!!
I'm creating this database for a claims management company. Yesterday I learnt about making a many to one relationship between the claims and clients tables.
Turns out its more complicated than that. Since I'm dealing with claims, a person may add their partner as the second claimant. (usually the case in mortgages)
So where parties A and B are in a relationship:
person A may claim on their own Person B may claim on their own Person A may be the primary claimant and add person B or conversely person B may be the primary claimant, adding person A.
The end goal is to automatically fill in a financial form (making use of a mail merge). So from what I know I think this means:
that grouping them as one contact is not going to work as I need them to be able to do a solo claim, and also I will not be able to easily change around who is the primary or secondary claimant, which will then carry over onto the mail merge.
So I think this means I need them as two separate contacts. However, I don't know how to create a link between them to easily add their partner to a claim.
Would this also mean I need a many to many relationship between clients and cases.
This application must be able to read from a big table in a separate accdb.
This separate accdb contains info that should NOT be available for all my users to copy, as it is valuable competitive information that could be abused by people with bad intentions. So, a linked table solution is not an option.
However, it should be possible to run parameterized queries that do simple look-ups that return only small/relevant portions of the database.
The problem is I need it to be only editable by 1 user, but allowing multiple other users to access it and view the records- just not able to add/edit/delete them.
The other question I had about the Split database would be- Does having a split database mean the data needs to be updated in 2 tables or am I taking Splitting databases too literally?
I have an A2007 database used for time and billing. As time goes on I've had to add more forms and especially more reports. I feel the because of all these "additions" the FE is getting a bit bloated, something like 2.2MB right now.What I want to inquire about is the possibility of moving at least some (if not all) of the forms and reports to another FE and can this be done without having to move tables and/or queries?
The navigation pane is "hidden" from the users so they don't see all the tables, queries, forms and reports but some are smart enough to figure out to "unhide" the navigation pane.Concerning the forms; there are certainly some forms that I do not want other users to open out of curiosity, or for whatever other reasons they might have, so these I would want to move. The same basic reasoning would apply to the reports.
My thinking would be this; move a particular form/report to a separate FE that merely acts as a "bucket" to store the form/report. Clicking on the control in the main FE would open the form/report stored in the other FE using the tables and queries in the main FE.can it be done without having to re-write a bunch of code? I know I can add code so certain controls aren't visible to certain users but I've not found a way to permanently lock and hide the navigation pane.