I have a field [CurrentDay] of type Date/Time. The values for this field are entered through the selection from the date picker. However the time of the day always come along with the date - even if it is not seen. This creates a huge problem when making a query based on this field because no results will be returned unless the time is included with the date in the criteria.
The other part to the problem is that I cannot find a built in function in the expression builder to generate the current date without appending the time - now() certainly does not do that - even if the time is not seen it is there.
I am having problems with this query: DELETE * FROM [TableOfTrainees] WHERE [TableOfTrainees].[CurrentYearTrainingDate]="" AND [TableOfTrainees].[LastYearsTrainingDate]=""; When I try to run it, an error points to the criteria. Both CurrentYearTrainingDate and LastYearsTrainingDate are Date/Time format. I need to be able to check if those fields have a date in them or are blank ("", IsNull and IsEmpty do not seem to work). Any ideas are deeply appreciated -- thanks ahead of time!
Hello all - One of my 3 users' computers keeps coming up with an error when I try to enter the following command in the "Validation Rule" field of the table design view:
>=#1/1/1998# And <=Date()
Some investigative work showed that it's erroring on this clause: "<=Date()". Any idea why it would error on her pc and not the other 2 pc's? Her pc is old, but we're all using Access 2002. The error says: "The function you entered can't be used in this expression." Any thoughts would be helpful. Thanks much.
I have a variable (dtDueDate as Date) showing as 6/28/2013. I want to append a time value to it (dtMaxTime as Date) which is 5:00 PM so dtDueDate reads 6/28/2013 05:00:00 PM. I have been going in circles trying to figure this out. My goal is to append this date to a table field which has a datetime (General Date).
:eek: I have tried almost everything and I still can get this to work. I thought I had it with this attempt until I inputted October data and found that Access was sorting it by Number vs. Date.
I am simply trying to compare the number of tickets opened each month to the number of tickets closed each month. I also need to address how a report will appear if no tickets were opened or if no tickets was not closed in a month.
Incase the SQL in screencap is too difficult to read:
Query: qryTotals_Assigned_And_Completed - This calls the following two queries. ############################################# SELECT qry_AssignedByMonth.MyAssigned, qry_AssignedByMonth.Count, qry_ClosedByMonth.MyClosed, qry_ClosedByMonth.Count, qry_AssignedByMonth.Month, qry_AssignedByMonth.Year, qry_ClosedByMonth.Month, qry_ClosedByMonth.Year FROM qry_AssignedByMonth INNER JOIN qry_ClosedByMonth ON qry_AssignedByMonth.Month = qry_ClosedByMonth.Month ORDER BY qry_AssignedByMonth.Month, qry_AssignedByMonth.Year, qry_ClosedByMonth.Month, qry_ClosedByMonth.Year; ############################################# qry_AssignedByMonth ############################################# SELECT (Format([DateAssigned],"mmm"" '""yy")) AS MyAssigned, Str(Month([DateAssigned])) AS [Month], Str(Year([DateAssigned])) AS [Year], Count(*) AS [Count] FROM tblRequests GROUP BY (Format([DateAssigned],"mmm"" '""yy")), Str(Month([DateAssigned])), Str(Year([DateAssigned])) ORDER BY Str(Month([DateAssigned])), Str(Year([DateAssigned])); ############################################# qry_ClosedByMonth ############################################# SELECT (Format([DateClosed],"mmm"" '""yy")) AS MyClosed, Str(Month([DateClosed])) AS [Month], Str(Year([DateClosed])) AS [Year], Count(*) AS [Count] FROM tblRequests GROUP BY (Format([DateClosed],"mmm"" '""yy")), Str(Month([DateClosed])), Str(Year([DateClosed])) ORDER BY Str(Month([DateClosed])); #############################################
Hello buddies :D, do you have any idea how to make this work?
To select data that falls within this criteria of date range between cboDate and cboDate2 (fields on my form). The date in [tblJobDetails]![timeIn] come in this format "08/17/06 10:24 AM", but the cboDate/cboDate2 (takes in date only e.g 08/17/06) what i am after is to evaluate specific hard coded time in addition to the date entered, i.e. even tho, i haven't entered time on the cboDate/cboDate2, I want specific time hard coded where e.g If i select a date range of 08/17/06 and 08/18/06 on my cboDate and cboDate2 it should really be evaluating: 08/17/06 8:00 AM to 08/18/06 8:00 AM.
This is the criteria i curentlly have on my query in design view tha works perfect in selecting date only. ([tblJobDetails]![timeIn]>=[Forms]![frmPendingJobs]![cboDate] Or [tblJobDetails]![timeIn]>=[Forms]![frmPendingJobs]![cboDate] Is Null) And ([tblJobDetails]![timeIn]<=[Forms]![frmPendingJobs]![cboDate2] Or [tblJobDetails]![timeIn]<=[Forms]![frmPendingJobs]![cboDate2] Is Null) How can I incorporate 8:00am to 8:00am into my cboDate and cboDate2. What can i do to make this happen? Your kindness will be greatly appreciated http://www.naijaryders.com/forums/images/smilies/thankyou.gif
I have a database with date and time each stored in a separate field. Now I want to query the database based on a start date/time and an end date/time. I started with the code below but it only returns events within the same time range on each day when what I really need is every event from a specified date and time through a specified date and time.
SELECT myTable.ID AS myTable_ID, myDate, myTime, FirstName, LastName FROM Staff INNER JOIN myTable ON Staff.ID = myTable.StaffID WHERE myTable.myDate >= #3/2/2014# AND myTable.myDate <= #3/3/2014# AND myTable.myTime >= #8:00PM# AND myTable.myTime <= #11:00PM# ORDER BY myDate desc
In the above example what I want is every event from 3/2/2014 8:00PM until 3/3/2014 11:00PM. But what I get instead is every event between 8:00PM and 11:00PM on 3/2/2014 and every event between 8:00PM and 11:00PM on 3/3/2014.
I have a form that is based on a parameter query. The user inputs an item number and the form opens in edit mode. The user clicks the "duplicate" command button and then changes the item number. I've incorporated GHudson's "A Better Mouse Trap" logic and when clicking "save" I get the type mismatch error.
I don't understand why Access is not returning the 3022 duplicate entry error.
When I click "debug" Access highlights the line as shown below:
Err_bSave_Click: If Err = 2046 Then 'The command or action Undo is not available now Exit Sub Else MsgBox Err.Number, Err.Description Resume Exit_bSave_Click End If
I have atable with fields time in and time out (short time type), in aquery i did a diffrence between that to fields, so I can know to evry employee every day how many hours work.
but, my problem is how do summation to the work hours to the month (it's a short time type).
example, an employee work from 8:30 to 15:00 in the first day, second day work from 9:10 to 14:20 ....etc at the end of the month i want to have report from query which give me sum. of hours the employee workes.
I created a Duplicate command/macro on a form and, when it is clicked on, a message appeared 'Run-time error '13' Type mismatch'. Debugging the command showed the problem was this code line:
MsgBox Err.Number, Err.Description
in the bDuplicateCurrentRecord section (shown below).
Below is the whole Duplicate coding. The coding was copied from another Duplicate template db as I am no expert on coding. It worked on 97 version but not on 2000 version.
Private Sub bDuplicateCurrentRecord_Click() On Error GoTo Err_bDuplicateCurrentRecord_Click
Beep
Dim sBookingID As String Dim sSerialNo As String Dim sNameOfHost As String Dim sTrustOrNonTrust As String Dim sDepartment As String Dim sContactTelephone As String Dim sContactMobile As String Dim sContactFax As String Dim sDateOfRequest As String Dim sDateOfFunction As String Dim sTimeRequiredStart As String Dim sTimeRequiredEnd As String Dim sVenue As String Dim sReasonForBooking As String Dim sNoOfGuests As String Dim sStandingOrder As String Dim sComments As String Dim sBookingReceivedBy As String Dim sNonStandardCharge As String Dim sTrustTotalCost As String Dim sNonTrustTotalCost As String Dim sWhenPaymentMade As String Dim sPaymentMethod As String
Err_bDuplicateCurrentRecord_Click: If Err = 94 Then 'Invalid use of Null' Beep MsgBox "A box is incomplete. Please ensure that all boxes are completed before attempting to duplicate the current booking.", vbInformation, "Invalid Duplication" Exit Sub ElseIf Err = 2113 Then 'The data you entered is not valid for this box. Exit Sub Else MsgBox Err.Number, Err.Description Resume Exit_bDuplicateCurrentRecord_Click End If
End Sub
Private Sub bDeleteCurrentRecord_Click() On Error GoToErr_bDeleteCurrentRecord_Click
Beep If MsgBox("Are you sure you want to delete the current record?", vbQuestion + vbYesNo, "Delete Current Record?") = vbYes Then DoCmd.RunCommand ac CmdDeleteRecord End If
Exit_bDuplicateCurrentRecord_Click: Exit Sub
Err_bDeleteCurrentRecord_Click: If Err=2501 The 'The RunCommand action was cancelled Exit Sub Else MsgBox Err.Number, Err.Description Resume Exit_bDeleteCurrentRecord_Click End If
I built a form that feeds data to tblOrders. In this form I have a button "Send", that must send a message to person from tblPersons. I have a problem to get an "email" from tblPersons. Any assistance will kindly appreciated.
Code:
Private Sub btnSend_Click() Dim mess_body As String Dim appOutLook As Outlook.Application Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application") Set MailOutLook = appOutLook.CreateItem(olMailItem)
Hello, I am having problems with one of my forms. I use a very simple database (4tables), basically I have a table for customers, and a table for sales. When I want to enter a new sale, I have to input the customer's ID and the total amount for the sale. But since I can't memorize all of the custemer's IDs, i have to go and manually check the customer table to get their ID.
What I want to do is to get the customer ID from the same form I use to enter the sale, by just typing the customer's name.
I have a table that has entries recorded with date and time in one field, and I want to have a query that returns all records of a specified date or date range, regardless of the time in the field.
I have tried
Code: Between [StartDate:] And [EndDate:]
And
Code: Between [StartDate:] & "00:00" And [EndDate:] & "23:59"
I would like to create a combo box (or something similiar if a combo box simply can't do it) where the list of choices in the pulldown shows only the matches of what a user types in. The list of choices are coming from a field in a table. Also I would like the "search" of the user's input to include what is "within" each choice, e.g. if a user type "ber", then valid results should be bertha, october, robert.
I have a database that stores information for lab testing. Each time a tech does a "step" in the test process he logs it in the table, using an input form. There are different categories, for example preparation, testing, analysis, etc, and each of those steps take time. I have the form autopopulate the date and time with NOW() evertime the form is updated. What i want to do is calculate the time it takes to do each in days. I can easily get how many days it was from now since they logged the test, =NOW()-TestDateTime. What I want to do is get the number of days it took to do each step, ie the number of days between each event. Is there a way to do this?
I have an attendance database and I connect the time attendance machine db to my access db, what i am trying to do is to generate a report that shows the time in and time out for specific date. the type of attendance db is date/time.
Please see the attached screenshot db from attendance machine.
an also some time there is duplicate entry, I need to get the first and the last entry only for specific date.
I have a date/time text field on a form with the General Date format and a combo box next to it that has sequencial times as the row source (IE. 12:45 AM, 1:00 AM, 1:15 AM, 1:30 AM, ETC.) When the user chooses a time in the combo box, I want the time portion of the text box to be updated with the chosen time in the combo. I have tried a few things but cant seem to get it right.
so i created a system to have events booked, and i am trying to check time availability of the event room available, but i dont know what wrong. it either my query or vba code. i have attached the attachment,
How can I obtain the value of a record from my subform in datasheet view?
Ideally I could double click in the "cell", for lack of a better word, and grab that value to pass through to another function.
On double click event? What then?
Edit: I suppose the user could select the row that the value is in as well. As long as I could then find the field I need from within the row. That might make things easier.
Edit 2: Sometimes I post before doing proper research. I've figured it out. Here is a quick example. The below code references an unbound subform called "Main_AU" where the field I want is "Description". The MsgBox is used to confirm that the code is grabbing what I want it to.
Code: Dim test As String test = Main_AU!Description MsgBox test
I'm trying to obtain all of the information in a text field for a query.
The user entered information and used a return (enter key) to enter information on a new line within the same field. The information after the return is not captured in the field in the query. Is there anyway I can capture all of this info?