Not allow any changes to tables

  • Thread starter Thread starter Thorson
  • Start date Start date
T

Thorson

Is there a way to protect table or a field in a table so that once a record
is entered no-one including the designer can change the record? Instead if
they want to change the record a box pops up asking if they want to change
it, they click yes, and then enter the change information in a "revision"
table.
 
Hi

No its not possible. Anyone who can create the application can change it.
Which if you think about it is the only way it will work. What will happen
when America joins the Euro - they will need to alter the currency to Euro
and if they person who made the application can't do it there will be a
problem

But - yes you can add any changeg to a new table - you may want to add a
date data entered field to the table - use the form to add the Now() when the
record is created after this use a filter to add the data to the new table -
don't forget to base you form on a linking query with both tables showing
only the latest update dated data
 
Thank you,

That actually works better than what I was planning on doing.

I have a form where the user enters the month (4 for april) that they want
to view the report for, this pulls up a report based on several queries.
What would I put in the critera field for the queries so that it will pull up
all records entered in the requested month (4 for April) up to the records
entered on May 15th... So for a april report all records entered from April
1st to May 15th?

Thank you!
 
Sorry you have me there - how is a date range up to 16th May part of April
I think it may be something to do with accounting so someone else may jump
in here with more details.

The date filter is simple
As long as you have dates on each record then you need to code the OnClick
to open your report where dates are between ### and ###
something like

Private Sub SomeEventHere()
'take the DateFrom and DateTo from a control on your form'
DoCmd.OpenReport "ReportName", acViewPreview, "",
"[DateField]>#DateFromHere# And [DateField]<#DateToHere#", acNormal
End Sub

where you get the dates from is up to you - a calender, combo box, etc
As an example you could build a combo showing each month records exist for
in your table so you don't end up with combo rows for records that don't
exist. There are lots of methods of getting dates - up to you which one you
choose

You don't need to filter the actual query - just apply the filter from your
form - this way you can use the query for other stuff - and it's simpler
which I like

You should not just filter for a month - use the year as well, unless you
want "every" month of each year to be included
 
I'm going to have to think about this for a while. I'm not sure if I can use
this to get what I want...
 
I'm going to have to think about this for a while. I'm not sure if I can use
this to get what I want...

Please explain what you want, then, perhaps with a bit more detail about the
business situation and an example of the data. A Query can get the data out of
your tables with a great deal of control and flexibility.
 
We are required to keep records of any movement of animals from one location,
deaths of animals, births, new animals entering etc. I have separate tables
set up to enter all of this information.

A report is then generated in the database each month that reports all
movement of animals and a total animal inventory. It reports the total
number of animals at the beginning of the month, end of the month and all the
changes.

The problem is when a correction needs to be made to a previous month's
report. Instead of entering in the record like it happened that month and
going back to change all the following reports(the inventory numbers are
affected) I need the report to pull up the new record in the month the
correction was "discovered" no matter when it actually happened.

For example, if an animal was born in January but there was a mistake and it
was not recorded until March I want the birth to show up on the March report
as a correction from January.

Right now the report just pulls from dates such as the birthdate, the date
the animal died or was purchased etc. I think putting a "entry date" column,
therefore automatically entering the date the record was recorded and setting
the queries to pull records based on the entry date would work. The problem
with pulling the records is that the records may be entered up to 5 days
after the end of the month, however new records for the next month may also
be entered at that time.
 
okay, So I haven't had much time to look at this until now. I think it will
work though. I currently have a form that the user fills out to pull a
report with all the records that occurred in a given month. It looks like
(using your code) I can limit that to the date they were entered (so if a
record occurred in May but wasn't entered until July it wouldn't show up
until the July report.)

I have very little experience with coding. I currently just have the user
enter in the "month" and "Year", could I have the Date from be the first day
of that month and the date two be the 5th day of the next month?
 
I have very little experience with coding. I currently just have the user
enter in the "month" and "Year", could I have the Date from be the first day
of that month and the date two be the 5th day of the next month?

A criterion of
= DateSerial([Forms]![YourForm]![txtYear], [Forms]![YourForm]![txtMonth], 1) AND <= DateSerial([Forms]![YourForm]![txtYear], [Forms]![YourForm]![txtMonth] + 1, 5)

will get that date range. Of course there's an overlap - records from the
first through the fifth will be printed twice if the user prints two months'
data in succession.
 
Back
Top