Modules & VBA :: Disable Forms From Being Accessed For A Period Of Time
Jul 22, 2014
I'm in the process of creating a database in Access 2010 that has two front ends, basically. What I want to be able to do is lock out one of those front ends for a specific period of time every day.
I have a working dB which can calculate a shift duration and sum total all shifts worked within a period for the purpose of producing a labor report for payroll. I have successfully used the DateDiff function and converted the minutes to HH:MM on my form and reports. Now I want to calculate elapsed time for a specific period within a shift, I'll call it OtherHours and I am aiming to calculate a portion of time that meet the following conditions below. I am using field names of [PunchIn] and [PunchOut] and both are of type General Date.
IF [PunchOut] ISNOT Saturday,Sunday EXIT FUNCTION ELSE IF [PunchOut] ISNOT Between Midnight and 0559 hours EXIT FUNCTION ELSE DATEDIFF ("n", <MIDNIGHT>, [PunchOut])
My thoughts are to solve the DateDiff portion and then figure out how to apply the conditions within the IF statements.
I have a pre-established database with a form that calculates total sales and tax for a time period i specify. I want to add a box that will display the number of sale records. Ex. if i had sales of 50,000.00, and that came from 200 sales i want the box to show the number 200.
I want to disable in VBA (.enabled = false) a lot of controlls, depending of some conditions. Is it possible to group (and having an unique name)these controlls to disable them all together at the same time.
How do I enter and store a period of time that may be of any length: years (.. unlikely but ...), days, hours, minutes, seconds (or even micro seconds) that I can later add to other dates or times stored in my database? How do I create a sensible data entry mask for yyyy/ddd/hh:nn:ss.999 and then convert this to a field compatible with date/time functions? And what format should this data take (be converted to ..?) and be stored in?
I have a database that has transactions since year 2009. I want the users to only be able to view and edit transactions that were entered in the last 6 days. I was initially able to do this by putting a filter in the Property Sheet section of the form and choosing Yes for Filter on Load.
However, a user was able to discover that by clicking on Clear All Filters, the filter I set was also cleared, thus making them see all the transactions beginning year 2009.
Can you help we have a data with a list of jobs that scores points, I need to build a query or scirpt that will add 5 points every 30 day fro the date the job was submitted this will help old jobs come the top of the list.
Over the past three months I have been trying to develop an application which can repeat appointment entries.
I would like to have the option to repeat an appointment entry for a given number of weeks.
For example if an appointment entry was placed for today (Wednesday), there would be a command to create additional duplicate enties for the same day of the week for a given period of weeks ie say every Wednesday for the next 52 weeks.
Any help on how I could approach this would be very much appreciated.
I have created a database in Access XP (2002). In a nutshell, the database records numbers of people attending a seminar; which can take place any number of times per week, and so hence can take place any number of times per month.
I have set up the query so that it can run immediately after a seminar to show the attendants who attended the seminar on that current date "Date()" in the criteria box. However, how would I go about setting it up so that it shows who attended every seminar in the current week or month?
We sell products out of vending machines and once in every few days (time span between readings may be different every time) read data from the machines using flash drive. Each reading from all machines produces an Excel file:
The only date that we have is the day on which the data has been read and this tells how many sausages were sold from the date of last reading till the date of current reading (after each reading counters are set to zero).
The problem is to get average amount of product X sold from machine Y on every calendar day. For a total rookie like me it seems like creating another column that would divide the Amount_sold by the number of days between two consecutive readings and put this average amount for every calendar day between these two readings. May it be done this way? How? Another way? How? I would be very grateful if anyone could help me and explain the solution in an accessible way.
I have designed an access application that logs emails that come into a department. However, the team leader has asked me to create a report to work out if emails were answered within a 24 hour period.
Is there a method to do this. It is not something I have attempted to do within access before.
I am using access 2013 and have an issue creating a query with employee hours for a two week period.
For starters I have a table with the following:
Employee Number, Date, Time in, Time out, Description, Rate Code, Week end, Pay Period. (there are a couple others but they are not needed for the query)
My table is set up this way so that each employee can clock in and out 1-4 times a day based on what they are doing. For example I may work from 6-8 in the office then 8-10 in the field. The office has one rate code and the field has a different one so i cant just be clocked in from 6-10.
At the end of the pay period I create a report and send it to an accouting firm who does the payroll. Right now I have to manually enter in each employees time. I was hoping that by using this table I could create a query that will give me the calculations I need in order to create the report.
In my query (to Start) I need to have the following with it set up per pay period.
Employee Number Rate Code Regular Hours Overtime Hours
How to set it up so that it calculates the hours based per rate code with the given pay period.
What I am currently doing is querying a table for the Count(*) for the day before. This works all well and good, but now I am wanting to break it down by a time range from the trDateDT field.
I've been struggling with getting a report to simply count records (I don't need any detail other than the counts). Here is what I have:
Table CompressorRoundsT contains these fields (many more actually but these are the ones I care about for this purpose):
Date, Shift, Round
Possible records in the shift field are 1st, 2nd, 3rd and the round field has Rnd 1 and Rnd 2.
For each date, I need to count the number of records per shift and per round. For example, the report should show that on June 7th, 1st shift has 14 records for round 1 and 14 records for round 2. Same for 2nd and 3rd shift. I don't need any other details of what the records contain, just the counts.
I've had some success but the layout ends up too spread out because it is including the individual records instead of just showing the counts and it isn't grouping the way I want.
It's a report for management to see how many readings (rounds) were missed in a period of time.
I have a table with 'General Date' column. So I have to create query wich extracts records between Last record (via Date field) and 'for example' 10 days before. But Last record in Date column may differ from Now().
When this is done I have create calculations with extracted records using agregate functions.
I'm trying to use Last function for Criteria putting it into Date field and substracting with -10 (for 10 days) but it doesn't work.
I have a table that contains a person ID, a start date for that person, and a GroupType. I want a way to count the number of people who started within ANY 40 day period. Then depending on that number , assign a value to the GroupType field (ie. if the no. of people is 1-15 then groupType = groupA, if its 16-30 then groupType = groupB, if its over 31+ then grouptype = GroupC. This needs to be re-counted every time a new record is added.
As well as having the groupType visible on the form for that person, I also want to be able to run a report showing all people, their start date and group type. Note that when start dates are entered these may be either future dates as well as dates in the past.
If possible, I would also like to track /store when a person's group type changed in another or the same table perhaps.
I was wondering if there is a way to disable a command button after it has been clicked for a small period of time. (lets say 1 second) stopping the user from any happy clicking. (fast repetitive clicks)
This is to do with viewing embedded images, i can explain more if required.
Hello, I would be very greatful if someone could help me. I have a Combo box called "COM01" which i want it to control the enable function of 3 Text Boxes TXT01,TXT02 and TXT03. When COM01 dropdown menu is used and field No is selected i want the 3 Text Boxes above to be set to Enable (False). The reverse when option Yes is selected is required for the same Text Boxes Enable (True) I will be adding the code to the Change() of the COM01 properties I have tried to use Case statments without success. Any help is greatly needed
I want code with message that can prevent user to adding a new record for an employee within specific of date through a form in the Ms Access database, but after a period of date i can, For example (after two months of the last record on the main table i can add the new record, otherwise the message will popup tell the user that this employee didn't complete tow months of last adding)
I was wondering if someone could point me in the direction of how to have a form open to the record it was on when it was closed. I know I've seen how to do this before, but I've spent some time searching and I can't seem to find it again.
I have a query which I have connected to an excel worksheet. The query displays as a table in excel. Recently I've decided to reorganise the data that goes into the query, however the query itself hasn't changed, there's a chain of queries all feeding data into each other to arrive at this final query, and it's further up the chain that I did the reorganising.
Now when I try to open the workbook, I get this error (the workbook is set to refresh data whenever it is opened)The query did not run, or the database table could not be opened.Check the database server or contact your database administrator. Make sure the external database is available and hasn't been moved or reorganised, then try the operation again.
If I try to edit the data connection or create a new connection, the query I've been using also no longer appears in the list of queries and tables I can get data from.The problem is, this wasn't the sort of reorganisation that I could do incrementally and then see what specifically caused the connection to fail. The query was out of action altogether until I'd finished the reorganising. So it's a bit complicated and I don't know what kind of things could cause a query not to be available to make a connection with Excel.
I am able to see from the list of queries I can connect to where the first query in the chain comes that I can't connect to. The only thing about this particular query worth mentioning is that it uses the Nz() function (it adds together sales figures by month from a list of sales, and in months where there are no sales, there is no data, hence null, when logically I want it to be zero, hence the use of the function).
I'm trying to turn any period entered into a certain textfield on my form into a comma (to prevent access from turning 1.1 into 11 for example).
I have the on dirty event set to me.fieldname = replace(me.fieldname,".",",").
Everything works fine as long as I use the period key on the numpad. However, when I use the regular period key on the keyboard, it does not convert it.
My problem is simple, and i imagine it is easy to fix. I have more forms in my db than I would like to count, and I have a couple lines of code to add to the onload event of each form.
Is there an way, without actually having to edit each form myself, to add the code i need to add to all forms. Is there some code I can write that will let me modify the on load property of a form, and save it?
I know what i need to do, minus the part where i actually change the onload event.