:eek: I have 'Arrival date' and 'Number of Nights' fields and i'm trying to find all clients that are staying on a certain date.
I enter the date in a form and reference this in a query.
In the Arrival Date criteria i have:
<=[Forms]![frmFindDate]![txtFindDate] And >=([Forms]![frmFindDate]![txtFindDate]-[tblStays]![NoNights])
which i thought might do it, but i get a message saying 'You canceled the previous operation.':confused:
If anyone can understand what I'm on about could you please help, it would be much appreciated.
I have the attached code in a query. It should be bringing back just one row for each record, however, if I have anything in any column other than Call_NUmber_int it brings back multiples if that record.
I am very glad to have found this forum, as I really need some help. I work for a non-profit and was asked to develop a database that would allow our services people to input data on employers that have been visited and track followups. I've tried to sort of use the "Access 2003 Inside Out" book by Viescas and elements of his LawTrack contact database sample. Confusion reigns supreme at this point. I've done some topical Access work before, and have even set up some simple databases using InfoPath as a front-end, but nothing this complicated.
I have the tables, and have attempted in multitudes of ways to establish the proper relationships. The most common problem is when trying to enter information into a form, at the point where it's time to enter contact information (three associated tables), I get that funny bell sound, and it won't let me enter proper information. A couple of times I noticed after completing all other fields and proceeding to a blank record, then coming back to it, it will then let me enter info.
I've changed the relationships and keys multiple times to no avail...:confused:
Here is the graphic of the relationships: http://www.jcindustries.com/employerdatabaserelationships.png
I need for tblCompanyContacts, tblEmployerContact, and tblContactEvents to talk to each other and to tblEmployerDemographics as there are many contacts to one employer and you might have many contacts for one employer but only one can be primary.
I'm thinking the contacts-related tables would be best nested as a subform in a main form....when I try to generate a form on those three tables using table wizard, I get a blank form :confused: I know the whole problem is how to use the keys and their relationships, but I'm key stupid at this point :rolleyes:
How can I show data by category? I have 2 tables 1) Categories, field 1 in Category Id, Field 2 is Category name 2) Contacts, Field 1 is Category name which is the relationship with the category name field in the categories table, the rest of the fields are adress, phone, fax ect, ect.
I would like to be able to view the contacts by category name, but I don't know how to do it. I have created a report but the report shows all the contacts, not by category.
What is the first step in accomplishing this? I am not very adept with queries so please I can really use some giudance. I have also been on the MSOffice traiing site but that didn't help me much. Of course I didn't know what I training to do :).
I'm trying to modify an existing database to make it easier and faster to search for homeowners. Currently, there is a search window that has two radio buttons, and a list box. one radio button is to search by address and another by last name. When you click one of these, it shows all the records in the list box. The problem is that 1. this is time consuming scrolling through over 300 records, and 2. more search options are needed, to include tag numbers of vehicles, and also phone numbers of residents. What Im trying to do is replace the radio buttons with a text box that will search all of the wanted fields, and produce a list of results in the list box. I'd rather not use a search button and just have the list box filter out as you type, but if a button must be used then thats fine. I've tried different ways, and searched all over the new for weeks, but cannot find the solution to my problem. Here is the current and original code. Thanks in advance for your help....Mike
Type of Search = Radio Buttons By Search Type = List Box HOMEOWNERS = table where all the info is located GET = cmd button to open form with results selected in list box
--------- Private Sub Option35_GotFocus()
End Sub
Private Sub Option37_GotFocus()
End Sub
Private Sub Type_of_Search_AfterUpdate() With CodeContextObject If .[Type of Search] = 1 Then .[By Search Type].RowSource = "" .[Search Text].Caption = "Select the Last Name to Search for" .[By Search Type].ColumnCount = 3 .[By Search Type].ColumnWidths = "1.5 in;1 in;0 in" .[By Search Type].BoundColumn = 3 .[By Search Type].RowSource = "SELECT DISTINCTROW HOMEOWNERS.LastName, HOMEOWNERS.FirstName, HOMEOWNERS.Address FROM HOMEOWNERS WHERE ((Not (HOMEOWNERS.LastName) Is Null)) ORDER BY HOMEOWNERS.LastName, HOMEOWNERS.Address;" ElseIf .[Type of Search] = 2 Then .[By Search Type].RowSource = "" .[Search Text].Caption = "Select the Address to Search for" .[By Search Type].ColumnCount = 2 .[By Search Type].ColumnWidths = "1.5 in;1 in" .[By Search Type].BoundColumn = 1 .[By Search Type].RowSource = "SELECT HOMEOWNERS.Address, HOMEOWNERS.LastName FROM HOMEOWNERS WHERE ((Not (HOMEOWNERS.Address) Is Null)) ORDER BY HOMEOWNERS.Address;" End If End With End Sub Private Sub Get_Click() On Error GoTo Get_Click_Err Dim Criteria As String Dim MyRS As DAO.Recordset
Set MyRS = Forms![BASIC DATA].RecordsetClone Criteria = "[Address] = """ & Me![By Search Type] & """" MyRS.FindFirst Criteria If Not MyRS.NoMatch Then Forms![BASIC DATA].Bookmark = MyRS.Bookmark End If MyRS.close Set MyRS = Nothing
I have an Excel sheet that I'd like to bring into an Access Form -- populate the Excel cells with data from textboxes on the Access Form and print it. I tried copy/pasting various things in, but it's pasting even text from a cell as an Excel object (let alone joined cells and images). Where can I find more information about this?
I found http://support.microsoft.com/?kbid=210288 But, when I put that code into the form for saving text from a text box to an Excel cell, it tells me that the word "Set" is a "Compile error: Invalid outside procedure."
Also, how do I refer to a joined cell? I've found that I can copy from a joined cell, paste into a host cell and select "Paste Link". This puts an absolute reference to the joined cell in the host cell (=$A$7, for instance) and when I change the joined cell the host cell is changed. Pasting =$A$7 seems to merely put the face value of "=$A$7 into the host cell.
New to this, but found some helpful tips/code already that I've integrated into my project.
You may well be familar the issue tracker database available for download from Office Online, well I'm using this for a little project I'm running.
What I want to do is tie up a few snippets as follows:
1-On my form I have a button called "Close" 2-When I click the Close button I want to check two fields, "closure" and "fix" and ensure that they have content i.e. not null 3-If they have content then I want to alter the "Status" field of the displayed record from Open or Suspended to closed (these are the three options for this field) 4-If the "closure" and/or "fix" fields are empty then I want a msgbox to pop up promting the user to fill out the relevent field/s, otherwise mark the record as closed
So;
Click close button, check contents of two fields, pop up a message if either or both empty, enter details in empty field/s, click button again and as both fields are now complete,mark the records status field as closed.
I've got so far but can't quite tie it all together, is what I'm asking possible? What do you need from me to help answer the question?
I am trying to transfer daily data that I get from three different queries all into one Excel sheet. I take it that you have to make one over-arching query which I have made called Awaiting Base.
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 currently have two froms, "add record" and "add record cont." The reason I have two seperate forms is because when clients create a new record information needs to be saved to two different tables and when creating one from with fields from both tables I ran into many problems. The two tables are named : tblMain, tblFileLoc Currently there is a textbox on both forms named "fileID" the FileID in the first form is from tblMain and is the primary key for that table, the FileID on the second form "Add Record Cont." is just a normal field. When clients enter in the new FileID in the first form "Add Record" and then move onto the next form "Add Record Cont." i need access to bring the entered FileID from the first form and Fill it in the FileID field in the second form. Currently I have tried making the control source for the textbox on the second form = the textbox on the first form but it brought up an error.
I have a date and time stamp in a Date/Time field of General Date format (3/1/2006 7:52:25 AM).
I wish to select query on the table's Date/Time field by date portion only (3/1/2006) and not include the time portion (7:52:25 AM) of the field.
Using this expression in the query's criteria - "Between [Enter Start Date: (MM/DD/YY Format)] And [End Date: (MM/DD/YY]" will not return the date ranges as desired without also typing in the full time string.
How can the date integer be parsed out and the query properly expression ed on the criteria field without using VB?
I have a query based on a table which has a date field. the field both in the table and the query have the time also in the date value so when I try to query on a date I get nothing if I copy the date and time from the field I will get the result for that record if I just use the date I get nothing. I have tried the format which does display just date but if you click on the field the time is also there You must be able to query for a date only and get all the records.
A few months ago I created a report that displays the results of a long union query comprising a dozen or so individual queries, each containing an expression that yields a date (or sometimes date and time). I set the report to group by query and then sort by the date expression. Now for some reason that I can't fathom the report has always only ever offered me the option to sort the date "A to Z", I infer it thinks the date is text, but this misunderstanding has never actually stopped it sorting by date perfectly well. It worked. No problems.
However I have recently added formatting to some of the queries so that they just display date, not date and time e.g. Format([dateandtime],"dd/mm/yyyy"), and now the sort by date in the report no longer works. None of the sorting or grouping options have changed, but it now sorts just by the "dd" component of the date - so it thinks 21st June is later than 20th July. why?
I've attached a stripped down version of a small order database I'm working on.
A user would enter an order, the amount and the date the order is required by.
As you can see from tbl_seasons, the business has financial periods that match the first and last 6 months of each year. Each season has a start date and end date.
What I'm trying to build are two queries:
1. A query which lists all orders and has an extra field which shows the "season_id" that the order (date) relates to (based one the start date and end date in tbl_seasons)
2. A totals query which shows the total order amounts by season
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
My database holds details of visits made to customers by support staff. I am running a query which returns details of the last visit made to a customer as below with results displayed on a webpage.
SELECT Visits.Date1, customers.CustID AS customers_CustID, customers.Customer, Visits.CustID AS Visits_CustID, Visits.Visitee, Visits.VisitType, customers.RegionID, customers.NextVisit, customers.NextVisitBy, customers.Confirmed FROM customers INNER JOIN Visits ON customers.CustID = Visits.CustID WHERE (((Visits.Date1)=(SELECT MAX (Visits2.Date1) FROM Visits AS Visits2 WHERE Visits2.CustID = Visits.CustID))) ORDER BY customers.RegionID, customers.CustID
SELECT MAX on Date1 is used to select the most recent (largest) date. The problem I have is that if 2 different staff members visit the same customer on the same day, the query logically returns 2 MAX date results for that customer, whereas I only want 1 result per customer. As the dates are the same I am not sure how to proceed. It doesn't matter which of the 2 results are returned. Does anyone have any ideas? Thanks in advance :)
ps - I can't perform MAX on the VisitID as the support staff don't always enter the visit data in the correct order meaning that an older visit date might have a higher VisitID than a more recent visit.
I have a database that has a query created, I want to refine the query to ask first for datefrom and dateto then display the relevant info between those dates.
I'm trying to get my "IncidentDate" field to autopopulate two other date fields to a few days from the "IncidentDate". The other two date fields are "ContainDueDate" and "RootDueDate". I'm trying to accomplish this on my "Test CAP Form"
I tried using the following in the BeforeUpdate of "ContainDueDate" and received a complier error: expected =
Code : DateAdd(d,2,[IncidentDate])
so I removed the parenthesis and nothing happened
Code : DateAdd d,2,[IncidentDate]
I even tried redoing it in the AfterUpdate of "IncidentDate" and nothing happened either
Code : DateAdd d,2,[ContainDueDate]
I'm not sure if I'm even using the right function to get what I want.
Can someone tell me how to get year to date totals, month to date totals, week to dates in a query? I need to get all three for three different fields.
I was not able to get the totals with the formulas given. I received the totals for each day instead. Are there any other suggestions? I am trying to different formulas, but they are not working either. I did try doing different queries with the formulas to see if that would work.
i have a query that populates all payments by date however, on lots of occasions, i have more than 1 payment per person per day so there are many payments made to 1 person in the same day. how can i sum this so my form that i am using for viewing purposes will show the total amount paid per day rather than per payment?
Hi Everyone i am trying to run a query that gets the records within a date range, asking the user for a start date and end date. How i think the problem is because the field is date & time.
>= [Please enter first date] <= [Please enter last date]
This seems to produce all the results. I even tried just writing an actual date in the criteria.