If Filed Hasnt Changed In 24hrs...flag It And Dcount The Results ?
Aug 3, 2006
Another question on how might be the best way to do things with dates ?
I have a simple database which is a fault database.
I get an email request to investigate something and I log it and give it a ticket number. If I email back , I put the comments that I sent in the email in the update field on the database.
When I create the ticket its in an open state with a date and time stamp of now()
When I close (drop down box with open and close as options) the ticket it automatically updates the time in the closed filed to Now()
What I want to do is when I updated my comments field , this sets a date value in a hidden field on the form of Now()
So then I need an expression that looks at the difference between the updated time and the now time
i.e. I update a call on 29/7/2006 at 10:00 am
Its now 30/7/2006 at 10:01
i.e 24hrs and 1 minute later
As its more than 24hrs this flags and output to a filed e.g. 1
I then total all the "1" and therefore I have a ticket count of how many calls have not been updated in 24hrs.
So Im assuming I will need an after update event on my comments field put today's date in this hidden field ,and then maybe some sort of code which is maybe on my switchboard which looks at the difference of these dates and if greater than (or equal too) 24hrs it will output a value of 1.
And If I can do this I can also have a flag if its more than 2 days , then clear the 24hr flag an increment a 24hr flag etc.
My tickets should all be closed with 24 hrs , so this is something to capture anything that is open and hasn't been updated in 24hrs
Id appreciate some guidance on the best way to do this ?
I have answered my own question so I thought I would share as I couldn't find the solution in any posts. I confess that I don't understand why my results were wrong, but I managed to get them right. :rolleyes:
When using Dcount in a query, I was getting results which did not match the query results. For instance:
Phase_2: DCount("Project_Phase_ID","tbl_Prj_Details","Project_Phase_ID = 2") gave an answer of 27 when there were in fact 41 projects in that phase.
Searching the forum I came accross this:
Count() always counts the entire domain.
So, Dcount is not counting the record set of my query but something else. I have 4 tables in the query and no idea what domain my dcount was looking at. I presume the various join types were messing with it somehow. :confused:
To get round this, I stripped out the Dcount expressions and changed the query to a make table. I then used the created table as the basis of a query in which I had my Dcounts. The dcount results now agree with the query recordset. :) :) :)
Any background on the bits I clearly don't understand will be gratefully received. I hope this helps someone else sometime.
I've been working on trying to get this code to work as expected for days. I'm trying to find duplicates (I can't use primary keys or indexes alone to weed out duplicates due to the structure of the tables involved) in a subform as a user enters data. As soon as a project number is added, the code is supposed to count the number of records that contain that particular project number as well as a category number (there can be multiples of the same project numbers as long as their category numbers are different). This is the code I am using in the "Before Update" event of the field in the subform:
Private Sub ProjectID_BeforeUpdate(Cancel As Integer)
Dim strCriteria As String Dim RecCount As Integer strCriteria = "([ProjectID] = " & Me.ProjectID & ") AND ([CatID] = " & Me.CatID & ")" RecCount = DCount("[ProjHrsID]", "tblProjHrs", strCriteria)
[Code] .....
What could I be doing wrong? Nothing about this code seems to work properly - even the Undo and Cancel=True is a problem (I get the "No current record" error).
I have a form in continuous forms mode... Each entry is something the user is supposed to check on once and hour and update. I have a "Last updated" field. Now() goes into that field every time the record is updated. I have a querry that will show the users records that are over an hour old.
How can I get Access to pop-up a window or something to alert the user they need to look at something? It would be really nice if Aspect would start blinking in the task bar or something.
I am tring to seperate a field using a query that has data like this: 02 04 08 18 20 25 31 32 35 39 41 45.... (10 sets of numbers) into there own fields... I cant seem to find something along those lines!
I have a table Client-Details,in which i have a record namely "bharti-chennai".this table is associated with aother table "release-details". bharti-chennai has records in relase details.i want to change the name of bharti-chennai to bharti -mumbai ..how to do it.
How to use like to search for items containing filed
I have a table as such and want to have a select statement look for instances where the RequirementName has Evaluation>Child this is used as the row source for a combo box.
Here is what I have so far and it does not seem to return anything.... this line is where i haveing trouble "AND RequirementName LIKE '%" & subcategory1.value & "%' " Private Sub Subcategory1_AfterUpdate()
Hi im having issues runing a query on a short date field in my works database calls [Date Logged] I am actually running the query from PHP/ODBC but have tryed running it in acess also..
I am using this query: SELECT * FROM Maintenance_Dbf WHERE [Date Logged] = #$date# ORDER BY Maintenance_ID ASC
Where $date is i have replaced with all of the following date types..
2007-05-21 2007-21-05 21-05-2007 05-21-2007
07-05-21 07-05-21 21-05-07 05-21-07
2007/05/21 2007/21/05 21/05/2007 05/21/2007
07/05/21 07/05/21 21/05/07 05/21/07
yet i cant get any results returned..
Here is an example date from RAW tables 26/04/2007 12:25:33
Any idea's? even the query builder in access doesn't pull up any records :S
Is there anyone who knows how to help me with this matter. I have a form that I can search for first and last name in. But when I try to do the same with the field for Social sequrity number I don't get it to work. Can anyone have a look at this attached zip database and help me? Sorry for the social sequrity number beeing named "personnummer" (it's in swedish.
This is my query: Forfall: Date()+([svarfrist].[svarfrist])
The case is to use this day' date and add the number in the table "svarfrist". The point is that the user are able to change the nomber of pluss days from time to time. This qery running, but it only give bad number of days...
How do I get access to auto fill a text (supplier)? I realize that for a new supplier I would have to input the supplier name, however my question is what should I do for Access to enable auto-fill so that the next time I have to input that supplier it would auto fill for me. This is happening in a single column.
For example: In the supplier column, I typed Dell in the first row, Apple in the second row, HP in the third row. Now when I start typing 'Apple' in the fourth row, I want it to autofill 'Apple' because I have already input that once.
I need a flag(indicator) for my database. This flag would be read by many different functions and depending on the value of the flag, would do one of two things.
Example: If the flag is "A", when I click a button in a form it does "C" function. If the flag is "B", then in case of the previous button it will do "D" function.
What I'm having a hard time with is where to store said flag. Mind you the flag is either one or the other ("A" or "B") for the entire database, not just a specific record(s). I thought about adding a field to my 'master' table and then use an update query to change all the values from "A" to "B" as needed, but that seemed a bit like storing redundant data.
there is a function that I wanted to do on my form but can't think of a way what I want to do is to show up a flag after 14 days and 28 days of a date with missed appointment being ticked say there are two fields in the section
hi I was wondering if anyone knows how to flag dates in access. I have 2 dates entered and I need a flag to appear if the second date is a month longer than the first date entered. Hope this makes sense and hope you can help
Hi, just so you are aware, I am totally clueless when it comes to Microsoft Access. I tried finding tutorials and help online that I could use to do this but I'm having trouble understanding what I'm supposed to do. I have two huge tables linked to each other by an ID number. One table contains multiple records with the same ID number while the other does not. There are records in the first table that don't appear in the second one, and there MAY be entries in the second table that don't appear in the first table. The second table has a flag that I would like to add to records in the first table that appear in the second table. What is the easiestt way to do this? This may be an extremely stupid question or it may be very hard, I'm not sure which, though I'm leaning toward it being a stupid question. Thank you in advance for your help.
I print a certificate for each person attending my class by sending the form (StudentForm) to a report . To save time I print and sign certificates for all preregistered students then during class I enter all students that enroll the day of class. What I would like to do is flag each preprinted record so when I select the print button after all students are entered into the database all certificates except the preprinted records will be printed. Any ideas on how to flag a printed record?
I have a list of locations in a sub form where a chart has been and the last record is it's current location. I'm generating a building report which should show a list of charts on that building, but it also shows it on old locations. So in the example, it shows for building 43 and building 83. I just need it to show on 83, how to accomplish this.
I'm aware of the wizard in MS Access that creates a new table containing duplicated entries that have been entered under one column, however, my problem is slightly more complex...
A contractor of mine has recorded information from CCTV surveys of sewers (not very glamorous I know!) in a Microsoft Access database. If you can imagine - the camera can be pushed along a pipe from both ends. Sometimes, the survey is abandoned in one direction and then repeated along the same length of pipe but from the other direction. The database contains (amongst other columns) a "start manhole" reference and a "end manhole" reference. eg:
16014
As you can see, the information contained by both entries will be the same (as they are the same length of pipe). Therefore, I was wondering how I could get MS Access to: 1. Recognise these 2 entries as duplicates 2. Create a table that hides the duplicated entry with a shorter "SectionLength" value.
I need to build a Query that will look at a previous table and a new table and flag any changes...what is the best way to go about something like this?
I have a knowledge base database which lets the user search for articles containing answers to common problems and issues. Some of the users want to be able to bookmark certain useful articles. The DB is a front end/back end design so I am thinking if I have one table stored in the front end which can be used to store that particular user's favourites then that would be great. However, I a little stuck on how to implement this. Ideally, I'd like a simple checkbox option next to each article, which when ticked, would store that article ID in that user's local front end.
I'm trying to create an access database to make an inventory of my model trains.
I have a main entry form (frmTrain) where I enter all sorts of info regarding e.g. a locomotive. This info is then stored in a table (tblTrain).
In the main entry form, I've put a combo box (cmbCountries) linked to a query (qryCountries) which queries the country codes from a table (tblCountries) that has three fields:
ID (autonumber) CountryCode (short text) (containing the country codes UK, FR, DE, ...) FlagFile (short text) (containing the name of the flag picture, e.g. UK.png)
The flags are stored as *.png files in a folder Flags that is in the same folder as the database file. I have chosen this approach instead of putting the flag pictures in an OLE field in tblCountries because I'd like to avoid being stuck to *.bmp files (don't support transparency). I'd also like to avoid having to mention the complete file path in the field FlagFile
I created a form (frmCountries) to easily add countries to tblCountries as needed.
Now back to the main entry form. The selection made in cmbCountries is stored in the field 'Countries' in tblTrain. When a country is selected in cmbCountries, I'd like that the corresponding flag is displayed next to the combo box.
I found an example on the web where an image field was used to display the flag, let's say with the following code:
Private Sub cmbCountries_Change() Me.ImageFieldName.Picture = Me.cmbCountries.Column(2) End Sub
Private Sub Form_Load() Me.ImageFieldName.Picture = Me.cmbCountries.Column(2) End Sub
and where the combo box had as row source (not using qryCountries):
SELECT tblCountries.ID, tblCountries.CountryCode, [Application].[CurrentProject].[path] & "Flags" & [FlagFile] AS Expr1 FROM tblCountries ORDER BY tblCountries.[Code];
The problem with this example is that, if you select in frmTrain e.g. UK, the UK flag is then displayed across all records in frmTrain. So the image field is not the appropriate field to display the flag in frmTrain and I guess an unbound/bound (?) object frame should rather be used.
How to display correctly the flag picture for every individual record in frmTrain corresponding to the country chosen in cmbCountries.