Queries :: Evaluate How Many Orders Were Open On Specific Day

Dec 12, 2013

Access 2010 project I am trying to develop for my workplace.

I want to be able to show a chart, a graph, of how many open orders we have had during the last month (showing per day) and during the last year (showing per months). In order to do this I am trying to create a set of queries that would provide me with such information in the form/structure;

[Date] [OpenOrdersTotal]
Yyyy-mm-dd 4
Yyyy-mm-dd 5
Yyyy-mm-dd 3
Yyyy-mm-dd 4

And after that I would create a chart I have
1. TblOrders
[OrderID] Autonum
[CaseID] Foreign primary key
[DepartmentID] Foreign primary key
[DateOrderMade] Date (yyyy-mm-dd)
[DateOrderAnswerd] date (yyyy-mm-dd)

2. TblDates
[ReportDate] Date (yyyy-mm-dd)

The evaluation in a query that runs all [ReportDate] logically would say;

Code:
Count(IIF([ReportDate] BETWEEN [DateOrderMade] AND [DATEORDERANSWERD]);1;0)

...but that wont do it.

I have attached a copy of the segment above ....

View Replies


ADVERTISEMENT

Evaluate Open And Closed Dates

Jun 23, 2006

I have two date fields that I am using a form to show the open and close date of an investigation. The opened date field is controlled by a textbox elsewhere on the form, but the date closed is controlled by the vbCalendar control. What I am trying to do in coding is to evaluate whether or not the closed date is before the open date. If the date closed is before the date open I would like a message box to open that prevents the user from moving forward and reminding them that the date closed is earlier than the date open. Is it possible with the vbCalendar option being able to change its focus continually.

View 1 Replies View Related

Queries :: Using Parameter Value To Evaluate Data?

Jan 23, 2014

I have query with a parameter [Category]. Based on this value i wish to select team data like if [Category]="Sale" then (team) in (1,9,5), if [Category]="Purchase" then (team)="7" else (team) in (1,9,5,7).

Both the fields team and category are from same table called 'rawdata'

Report displays the data datewise but it is grouping according to team,which is not what i required;

Date CntValues
12/1/2013 1 [team 1]
12/1/2013 3 [team 9]

output should be

12/1/2013 4

that is to avoid duplicate date values.

View 5 Replies View Related

Queries :: Can't Evaluate Date In Text String

Apr 17, 2014

I'm working with a table of financial transactions. I need to know the date a record relating to cash received actually arrived in our bank, but the software doesn't allow the user to enter this, so I've asked them to enter it into a text reference field, e.g. 'Other Text XX 16/04/14', and then I've got a formula - CDate(Right(Trim([RefField]),8)) - which takes the date from this reference.

This works fine, but it's really important I don't miss any of these records due to the date not being entered, so what I'm trying to make is a formula which will give me the date from the ref field as in the formula above if there is one, but if that formula gives an error (so the date has been missed out or incorrectly entered) then I want to take the date from another field, called [DateAdded] as a failsafe.

I can't work out a formula that won't give me an error, i've tried loads. First I tried :

iif(iserror(CDate(Right(Trim([RefField]),8))),[DateAdded],CDate(Right(Trim([RefField]),8)))

But that gives an error, and I think from looking at forums that Access evaluates both parts of an Iif function so it'll do that.

It seems like other people are saying that you need to use Nz, IsDate or IsNumeric or something along those lines instead of IsError to evaluate the field, but I can't get that to work as it's not a field, it's a portion of a text field.

This is my latest attempt:

Join Date: IIf(IsDate(Right(Trim([RefField]),8)),[DateAdded],[Calc Date]),

where [Calc Date] is an expression field with CDate(Right(Trim([RefField]),8)) in it, but there's the #Error again.

How can I use iif to pick either a date from a text string, or where that results in an error then another date field?

View 9 Replies View Related

Queries :: Building Crosstab For Logic To Evaluate 2 Columns

Jul 17, 2013

Record Primary Key: ID_Wells..The TxtFedStCo has Fed, St, Co, ... in one field - and a Dt_Apd_Sub (date submitted) .There can be zero or many dates submitted for each Fed or State.

Objective:
If
A Fed has (1 or many) date submitted
AND
A St has (1 or many) date submitted
Condition is TRUE

How do I get to the next step? The reason for doing this in SQL is to prototype in Access, then move this over to TSQL later.

View 1 Replies View Related

Forms :: Run Specific Queries And Open A Report Using Combo Boxes

Jul 30, 2013

I have a form which runs specific queries and opens a report using combo boxes, these work perfectly fine if I just try to run them in the form. I have put the form into a navigation form and if I try to run the same query I get parameter queries popping up instead of just running the query and opening the report.

View 2 Replies View Related

Queries :: DLookup Command And Evaluate Return Value For Null To Be Used To Control Program Flow

Apr 6, 2015

I have a search from that has an option group, text fields, and a checkbox where the users selects a variety of option that generates a query. If the query return at least on record a split form (form on top/datasheet on bottom) is displayed and the form has an Edit and Close button. If the query returns no records the form is still displayed except the buttons are not visible.

If I knew the result of the query and then made a decision whether to open the form or release control back to the search box that would be great. To open the form I am using VBA with the DoCmd.OpenForm(,,"MyQuery","criteria") command.I thought about using the DLookup command and evaluate the return value for null to be used to control the program flow.

View 3 Replies View Related

Modules & VBA :: Entering Orders Into The Orders Table?

Mar 5, 2014

I have a database where I have 3 tables. first is client data, second orders data and third the products data.
What I would like, is to have a button on my form that after selecting from a combobox a product, it wil enter it in the tabel orders in the next available free record (row). I created a button and the combobox in the client form. The Products table has also the price per unit in it. It should take the whole row of data and put it in the Orders table.

Is there a way to do this? I guess it needs to be done with vba, but not sure.

View 9 Replies View Related

Sort Orders In Queries

Dec 7, 2006

i've now converted a large database to run with sql as well as linked jet tables. The main issue was checking every recordset to ensure it opened properly. I also found that sql returns a few different errors code from Jet, that needed trapping differently = all OK.

Now, in some cases I had opened the backend Jet table directly in order to use seek on a particular index, so this needed changing, as this is not available with SQL

I may well be wrong but i couldn't see an easy way of traversing a recordset table in SQL/ODBC according to a particular segmented key

Instead I was able to modify my process to extract the data I wanted with a query, and I then used a recordset on the query, which is fine.

HOWEVER, to emulate the index I was using, the query is sorted on about 6 or 7 different segments, the first of which is CustomerCode. Now when I opened the query to view it, I changed the sort order by clicking on a date column (as it happens) to sort it. When I then closed and reopened the query it still opened sorted on the date column, which is not right, as the customners are now all out of sequence. When the whole dataset was re-extracted it did return to the original and correct order

THEREFORE Is there a way of forcing a query to reset itself to its original ordering sequence. I think it is not likely that any user would ever open a query directly anyway, but it would be nice to ensure the query is always processed in the intended order. Perhaps it isn't a problem at all - maybe when a query recordset is opened in code, the sort order is reset anyway, but I would appreciate some views on this.

Thanks in anticipation

View 3 Replies View Related

Queries :: Finding Work Orders That Only Contain Certain Type Of SN

Aug 13, 2013

I am new to access but understand how to do a simple query. in this case i have 4 fields in my query. I only want to return work orders where the only SN's for that work order begin with 600 or NEX. when i use the like button it gives me all those work orders, however it doesn't exclude the work orders with other types of SN's. is there a formula i can use that says return work orders that only contain this type of SN?

View 14 Replies View Related

Queries :: Dates In A Query - Show Orders By Month For Last 12 Months

Apr 22, 2013

I want to create a simple query from a list of orders dating back over 12 months.

The fields I have is Ord_Date, Qty

I need to show the orders by month for the last 12 months.

The problem I am getting is that the orders for the month of April (as we are in April now) contain orders from 1st - 22nd April 2013 and orders from 23rd - 30th April 2012, therefore confusing the figures.

I would just like orders grouped by month with a total qty dating back 12 months, but without any old orders for the current month.

View 6 Replies View Related

Evaluate A Condition

May 11, 2007

Please have a look at the following code (I am not good at VBA or SQL).

Me.[txtBox] = DLookup(“[SNum]”, “[Table1]”, “[RecID])
If Me.txtBox =>2 Then
Condition if true
Else
Condition if false
End If

I type a value in my [txtBox], a number. I want to evaluate if the typed value meets the condition or not. [SNum] is serially numbered and [RecID] is autonumber Primary Key. The above code is not working. How do I achieve this? Please help.

View 2 Replies View Related

Open A Specific Form

Nov 2, 2006

I have a table that depending on a certain field in that table it will be able to open a specific form.

In other words I have multiple forms but only want a specific form opened when accessing a record if that record has a field with certain criteria

if that makes any sense

thanks

View 1 Replies View Related

Open Specific Form

Jan 3, 2007

I have 2 forms one named "View" and the other "edit" on the form "view" the final user cannot edit any field as set from the form properties the form "edit" has no restrictions, what I need is to put a push button on the form "View" that will open the form "edit" showing the same record as on the form "View"
Hope I explained my problem :)

View 5 Replies View Related

Open Form To Specific Tab

Jun 19, 2012

I have an input form that opens another second input form. The code below opens the form to the correct record.

However, the form that I open has a bunch of tabs on it, and I want to open the specific record right to the tab "Technology_Page". Any way that I might be able to do that right from this statement?

Code:
DoCmd.OpenForm "ProjectDetailsActive", acNormal, , "PPID = " & Me!PPID

View 1 Replies View Related

Open Word Specific Page

Apr 5, 2008

Anyone able to help. Can a command button be coded to open either a Word or PDF file at a specific page number? Any help really appreciated.

View 1 Replies View Related

How To Open A Form At Specific Record?

Feb 2, 2005

Hi,

I want to open a new form which is similar to the form it will be opened from. Only difference is the new form I want to open is designed for printing purposes.

I'd like to access the this new form by hitting a button that opens the print form for a user given order number. Any ideas if this is possible? Thanks

View 1 Replies View Related

Open Specific Record - Syntax

Jun 14, 2005

I am trying to use the double click event of a listbox to open a form to a specific record. The problem I have is when I double click a record, Access pops up a box asking for PONumber (which is in column 0 of the listbox).

Here is the code that I am using:

Private Sub lstPOInfo_DblClick(Cancel As Integer)

Dim boStatus As Boolean
Dim strDocName As String
Dim strLinkCriteria As String

strDocName = "Orders"

' function checks to see if the form is open or not
boStatus = fIsLoaded(strDocName)

If boStatus = True Then
strLinkCriteria = "[PONumber]=" & Me.lstPOInfo.Column(0)

Forms![Orders].FilterOn = True
Forms![Orders].Filter = strLinkCriteria

Else
strLinkCriteria = "[PONumber]=" & Me.lstPOInfo.Column(0)
DoCmd.OpenForm strDocName, , , strLinkCriteria
End If

End Sub

I'm sure it's a syntax error on the "strLinkCriteria = "[PONumber]=" & Me.lstPOInfo.Column(0)" line.

View 5 Replies View Related

Open Specific Form From Combo Box

Nov 12, 2005

I have a form with a subform which has a lookup table (combo box) as a field. I want to be able, when I select a certain item in the lookup to have it automatically open a form. e.g. A field called insurance class - I select motor, I want the motor details form to open. If I select Fire, I want it to open the fire form and so on. I have already created the forms. Please help!

View 14 Replies View Related

Open A Specific PDF Page On Access

Oct 20, 2015

I want to create for each record I'm introducing in my database a link to open a specific page of a pdf file I stored in a folder.

View 7 Replies View Related

Evaluate A Field In Access Database

Aug 28, 2014

I am trying to evaluate a field in an access database. I have entered iif([fieldx]="Contributor",1,0). The field that I am evaluating has the word Member or Contributor in it, but my formula always returns a zero (0). What am I doing wrong?

View 14 Replies View Related

Open A Form And A Subform On A Specific Record

Mar 7, 2006

I am trying to open a single form with a single subform with a command button. I would like to open the form with the subform on a specific record but I am not entirely sure how to do this, I was wondering if someone had any advice that could help.

View 2 Replies View Related

Open A Specific Excel Doc From Access Form

Jul 5, 2006

I know how to create a command button to open excel, but is there a way to create a command button to open a specific excel file?

View 1 Replies View Related

Command Button To Open Specific Record

Oct 6, 2004

Hi All,

I have a form called "frmProducts" which is linking to table "tblproducts".

Easy Enough...

The form shows all the Products information (fields).
I have a "More Info" command button (cmdMoreInfo) next to every record in the form.

When the command button is clicked I would like it to open up another form "frmMoreInfo".
But On frmMoreInfo I would only like it to show that specific product.

I have tried the following code on the on click event on the command button but it was always asking me for the value of Form![frmMoreInfo]![txtInternalCode]

Code:Private Sub Command12_Click()On Error GoTo Err_Command12_ClickDim stDocName As StringDim stLinkCriteria As StringstDocName = "frmMoreInfo" stLinkCriteria = "Form![frmMoreInfo]![txtInternalCode]=" & Me![txtInternalCode]DoCmd.OpenForm stDocName, , , stLinkCriteriaExit_Command12_Click:Exit SubErr_Command12_Click:MsgBox Err.DescriptionResume Exit_Command12_Click End Sub

Any Ideas?

View 4 Replies View Related

Forms :: Open New Form With A Specific ID (or Name) Filled In

Feb 4, 2014

(MACROS ONLY)I am looking for a way to open a form in order to add a new record. The idea is that I open up the form with a MemberID and possibly the name already filled in on the relevant form. It is merely for ease of use regarding the user.

I have got as far as opening the the new entry form. I just need to pass the MemberID into the relevant field. If I use the wizard it is just finding a record of a pre-filled entry.

View 7 Replies View Related

Modules & VBA :: Go To A Specific Record In Open Form

Mar 27, 2014

I have a form that is opened as hidden when my startup form loads. Data gets entered into it from other forms so whenever I switch records the hidden form needs to be opened to the matching record.

To accomplish this, I have been using the DoCmd.OpenForm in the OnCurrent event with the WHERE clause matching the PK/FK. I have had no luck with the SearchFor method.

It seems silly to have to keep reopening a form to go to a specific record when the form is always open already. Plus, I am wondering if it is affecting the forms' load times.

Is there a better way to do this (there must be)?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved