Defining Criteria In Form

Aug 4, 2005

Hi all - I have a suite of reports which provide customer details. They all require the user to input the name of the customer.

The way it works is that I have a query which returns everything for the customer.

Then I have other queries based on the first query which bring back the specific information I want regarding the customer.

This works fine when the customer's name is entered using [Enter Customer Name] in the criteria of the relavant field in the first query.

However, because a user might want to run several different reports on the same customer it becomes a chore for them ot repeatedly have to enter the customer name.

My solution is to have an unbound field in the reports menu for the customer name and to use this as the criteria in the query, so it now reads [Forms]![FrmMenu]![Text42].

The first query runs fine, but the queries based on it are suddenly not returning any records.

There is undoubtedly a simple explanation for this but as I'm quite dim, I can't see it. Could somebody enlighten me and maybe even suggest a solution?

View Replies


ADVERTISEMENT

Defining Query Filters From A Form

Nov 28, 2005

I have a database about when computers have been installed

I have a form
It has a drop down list with Januray through to December

I want the user to select a month and a year and then click the command button and it will run a query displaying all the computers installed in the month of that year

any ideas people?

View 4 Replies View Related

Forms :: Defining Colors On Form Control

Mar 30, 2014

I have to create a control on a form that will be able to change to one of ten colors, some of them are subtle shades. I will be doing this from vba on the control. I know how to do all of this except defining the colors.

I keep seeing the 3 part RGB(xx, xx, xx) etc. but I can't find the values for it that will give me the exact colors that I need!

I also saw a possibility of using a the hex equivalent for the color but I couldn't make that work?

View 2 Replies View Related

Defining Relationships In Access

Apr 25, 2006

Hi,

I seem to be stuck on the simplest of tasks with both google and forum searches coming up with information that’s either too simple or too complex for my needs (not time wasted though because I’m learning all kinds of related stuff).

How do I join my tables with one-to-one relationships?

[edit] Doh, got this one now - by indexing without duplicates then saying all in one have to link to one in another:D

How do I define both fields in a linking table as composite or two field primary key?

View 11 Replies View Related

Defining Primary Key From Two Fields

Mar 23, 2008

I have this table:

intSalesID (Number, Indexed: (Yes No Duplicates)
intCarID (Number, Indexed: (Yes No Duplicates)
intQuantitySales (Number, Indexed: (No)

This table is a cross table from the two tables tblCars and tblSales where the intSalesID and intCarID are Primary Keys. In this table I didn't set the P.K. I saw databases that have P.K. in tables like this deined from the two fields (intSalesID and intCarID, would be in my case). I wanted to ask what is the difference if I leave this table like this and if I set this two fields to form a P.K.? What is the difference in these twi cases? What do I get and what I don't, if I do either way? Thnx.

View 3 Replies View Related

Defining A Checkbox As A Variable

Jun 6, 2006

Hello all,

I was wondering what should I define a chechbox as if I want to make it a variable, so that when it is checked (= -1), I can check for the -1 and loop somewhere.

Thanks

View 1 Replies View Related

Defining A Checkbox As A Variable

Jun 6, 2006

Hello all,

I was wondering what should I define a chechbox as if I want to make it a variable, so that when it is checked (= -1), I can check for the -1 and loop somewhere.

Thanks

View 1 Replies View Related

Defining A Checkbox As A Variable

Jun 6, 2006

Hello all,

I was wondering what should I define a chechbox as if I want to make it a variable, so that when it is checked (= -1), I can check for the -1 and loop somewhere.

Thanks

View 5 Replies View Related

TransferSpreadsheet - Defining Range Syntax?

Mar 7, 2005

Hi,

I am trying to auto-import data w/ a single-click from several Excel sheets. A sample line:

DoCmd.TransferSpreadsheet acImport, , "tblTS1", filename, True, Product!A1:H100

where
tblTS1 - tbl where I'm putting the data
filename - c: est.xls
Product!A1:H100 - range of data I want in sheet Product

I am having problems w/ the "range" portion of Transferspreadsheet (I know it's this portion, because it works when I pre-name the range in Excel). I have tried all sorts of variations on the syntax:

Product!A1:H100
"Product!A1:H100" or 'Product!A1:H100'
"Product" & ! & "A1" & : "H100"
"'Product'" & ! & "A1" & : "H100"
Product & "!" & A1 & ":" H100

I get the error msg:
The MS Jet database engine could not find the object '$:'. Make sure the object exists and that you spell its name and the path name correctly." or "Syntax error"

I wanted to mistake-proof the data transfer, so I did not want to:
- predefine the range in Excel (under InsertNameDefine)
- have the user enter values in text boxes

Any help w/ the syntax would be greatly appreciated!

Cheers,
dvs :confused:

View 1 Replies View Related

Make Query - Defining Fields

Mar 30, 2007

When I run this query, the fields in the new table contains 253 characters. How do I specify in the SQL command that the field Carg2 and Carg3 will contain 3 charachters ?

SELECT dbo_allesc.AccReport, Left([AccReport],2) AS Carg2, Left([AccReport],3) AS Carg3,.........................
INTO regTabell

Thank you, Tor

View 2 Replies View Related

Modules & VBA :: Defining New Date Format

Mar 17, 2015

how shall i define my new Date or numbers.Now "yyyyXX" this is my date "y" is year 4 digits and "XX" is my problem 2 digits. I ll give an example,

(XX = 01....36) XX can be max 36 and min 01 of course. f. Exp. 201436 and next number shall be 201501.

the biggest problem is different of these number with basic math 201501-201436= 65 but for me it should be 01... The Question is; How can define these ??

View 8 Replies View Related

Defining Sampling Periods Using A Calculated Field

Jun 6, 2006

We have a db of salmon survey data where catch data is recorded by date, site, etc.
Historically, we have used ‘sampling periods’ to group our results into blocks of time that can be compared from year to year, and within year.

Now, having frequented this forum I’ve read that we shouldn’t store information in tables that can be calculated from fields and I want to try to follow that advice in this instance but am having trouble working this out.

Here’s how we define a sampling period.

1.The start date of the first sampling period in a sampling year is the last Monday in the most recent November.
2.Each sampling period is 14 days long.

What I want to do is have a query use the date of a set to calculate what sampling period the set belongs to. I have an idea that I could use a datediff function to calculate this if I can figure out the ‘last Monday in the previous November’ part. I’ve searched this forum and googled but am having trouble finding anything that I can adapt to this as a query expression.

Anyone care to help a fish bio out? Much obliged :)

View 5 Replies View Related

Defining The 3 Highest Values In A Series Of Fields

Nov 2, 2007

Hello Everyone,

I am in need of your vast array of knowledge and experience. I have been fighting with this Access report for a few days now, and I've finally decided to ask for your help.

I am running a report which provides a look at a set of 12 survey results. The 12 items are numerical in nature and are decimals with 2 decimal places. What I am trying to do is have Access automatically highlight the top 3 scores in one color, and the bottom 3 scores in another color.

So what I need is an expression that allows Access to discern the top 3 and bottom 3 from the series of 12 scores. in Excel you can identify the top score with this with the formula "Max(A1:A13)", but seeing as in Access we don't have the cell identifiers, this approach will not work.

I know that I will need to use conditional formatting in order to get the cells to highlight. I also see that there is "Max" and "Min" functions in Access as well, and I attempted to create and expression like this "=Max([field 1] AND [field 2] AND [field 3] AND, etc...)" with no luck. I also tried changing the "AND" to "OR", again without luck.

One thing that I should mention is that the report does contain a lot of other data, so I need to be able to apply whatever the best fix is, to only those 12 fields.

Unfortunately I am not accustomed to using code, and as a result I am unsure of how to input it properly. I am certainly open to code solutions, but I would also need a explanation of how to put it in properly.

The easiest solution for me, if possible, would be an expression that I can enter into the conditional formatting wizard to tell it to highlight the values.

If anyone has any ideas, I would appreciate it. I'll buy you a virtual beer :-)

View 5 Replies View Related

Is It Possible To Choose No Criteria On A User-defined Criteria Form?

Sep 15, 2005

I created a form that allows the user to choose the criteria that they want to see on a report using =Forms!formname!controlname in my query. It works great but I want to also allow the user to choose nothing and return all records instead of limiting them to choose just one type of record. Is this possible? Before I created the form my query had the [Enter parameter] on one criteria line and [Enter parameter] Is Null on the next criteria line and that was working great for my use but I need to create a simple form for other users.

View 1 Replies View Related

:confused: Defining Tables :confused:

Oct 31, 2006

Hey guys i would really appricate some help

I have made severa databses before but im trying to make this one perfect and im curious, when defining tables should you include atributes about an entity that are static?

Its kind of hard to explain what i mean but for example in a shoe shop a staff member gets commision on what they sell (ie 5%) so when producing the table should a coloum be reserved for commision or should this be left out as it will be calculated later on in a querie and if so should i state this in the design section of my database?

any opinions would be greatly received as i have been reading books on sql and ERD's for days and havent been able to obtain any answers

cheers guys

mike

View 1 Replies View Related

Queries :: Retrieve Criteria From Form / When Form Is Closed

Mar 28, 2013

I have a query that retrieves one of its criteria from a form. I have referenced correctly the value on the form from the query, and it works, but what I wanted to do is a bit more complicated: when the form is closed, I want to launch the query with a "default value". I tried to do it in 2 different ways:

a) Defining an "IIf" at the query criteria: I would need a function that checks if the form from which I retrieve the values is open.
b) Defining public variables with a default value, which would be changed from the form: I don't know where/when to initialize the value of the variable.

Query gets criteria from form when it's open. If form is closed, query uses default value.

View 1 Replies View Related

Need To Add Second Criteria Onto Form

Jul 9, 2015

I have two Parent Forms on one screen, no Sub Forms. So they are not linked as Parent and Child. The First form applies a filter to the Second form. The First Form contains a field called "TaxYear". You double click the TaxYear field (running the code below) and it filters the second form so that the Second Form SPYDTaxYear = the First Form's TaxYear.

The filter by SPYDTaxYear works fine. I need to quickly add a second criteria to the filter called, "PropertyID", an integer. So, on the First Form you double click on the TaxYear field and it should filter the Second Form by both SPYDTaxYear and PropertyID.

Code:
This filter by Tax Year works fine.

Private Sub TaxYear_DblClick(Cancel As Integer)
Dim stTaxYear As String 'From First Form
stTaxYear = Me.TaxYear 'From First Form
Forms![Frm_RecordstatusFrame]![Frm_SPYDTaxYears2].Form.FilterOn = False
Forms![Frm_RecordstatusFrame]![Frm_SPYDTaxYears2].Form.Filter = "[SPYDTaxYear]= '" & stTaxYear & "'"
Forms![Frm_RecordstatusFrame]![Frm_SPYDTaxYears2].Form.FilterOn = True

The above filter works but it needs a second filter criteria of the PropertyID, an integer.My modification of the above filter after adding [PropertyID] errors out with a data type mismatch.

Private Sub TaxYear_DblClick(Cancel As Integer)
lngPropid = Me.PropertyID
stTaxYear = Me.TaxYear
Forms![Frm_RecordstatusFrame]![Frm_SPYDTaxYears2].Form.FilterOn = False
Forms![Frm_RecordstatusFrame]![Frm_SPYDTaxYears2].Form.Filter = ("[SPYDTaxYear]= '" & stTaxYear & "' and "[Propertyid]= " & lngPropid &"')"
Forms![Frm_RecordstatusFrame]![Frm_SPYDTaxYears2].Form.FilterOn = True

So the only thing I need is correct the filter so that it includes SPYDPropertyID which is an integer.I am prepping for a demo today at 10:00 AM. This is the last issue that is still not working correctly.

View 3 Replies View Related

Form Filter With More Than One Criteria

Apr 12, 2006

Hello guys,

Hope you're all well.

I need some help with a form filter I need the form to filter out those records with a STATUS that is "OVERDUE" and a date that is < date().

I've tried...

Me.Filter = "[Status]='Overdue' AND [deadline] < date()"
Me.FilterOn = True

type mismatch ....

I'm confused how the syntax works

does anyone know how the expression should be written.

Cheers
Paul
:)

View 3 Replies View Related

Criteria On Open A Form

Nov 16, 2005

I was wondering if it was possible to add a parameter to the record source Query of a form depending on the value of an other field on the open event of the same form?
I was thinking to use 3 Sql statment SQL1, SQL2, SQL3, on the open event of the FrmOpen.
On Open then the RowSource of FrmOpen =SQL1
If field? = "A" Then
the RowSource of FrmOpen=SQL2
Else
the RowSource of FrmOpen=SQL3
End If
I did try but it doesn't work so I needed to know if it was possible to achieve this or not?

View 1 Replies View Related

Using A Form For Criteria Variables

Jan 29, 2006

I have a table Names containing Recnum and Last Name. I have a table Grades including Recnum, Names and Grades. I have a Report which Through a query Reports the grades and averages for each name. I would like to be able to query for an individual name using an entry form. How do I get the name from the form into the Criteria in the query grid.

View 1 Replies View Related

Multiple Criteria From Form

Feb 10, 2008

I have a form that has seven unbound fields named txtCityCriteria1 through txtCityCriteria7

The idea is to have the use type in up to seven cities and have this applied to the criteria of the city field in a query. This query is the datasource for a report. I know how to do a single text ....

[Forms]![frm_OpenReport]![txtCityCriteria1]

in the criteria row would do the job. But how can I do seven?

Oh and if all are left blank i need it to open another form that informs them of their mistake.

I have looked through these forums and have found several possible solutions but I can not get any to work. Any assistance would be greatly appreciated. Take it easy on me I am relatively new to this code thing. Used to do everything in macros.

View 1 Replies View Related

Query Criteria From A Form

Feb 28, 2008

I have a form I am using to either select an Equipment ID or pull all records if no id is selected. My code in the query looks like the following:

([Forms]![frmWOCommentRpt]![cboEquipID]) Or Like "**"


When I run this, however, it only does the Or part. If I select an equipment ID on the form, it doesn't just pull that. I'm sure this is a simple fix, but I can't see it. Any ideas?

View 3 Replies View Related

Run Form With Filtered Criteria

Jan 27, 2006

Hello all,

I have looked through the forum, found some things, but not sure if they help with what I need specifically. I tried looking at the microsoft website, but can't really follow some of the things they have there.

On clicking a form (called Manager), I would like a list of some fields from a query (called queryMgr) to pop up, so that I can put in the criteria as I would if I just used the query, and then submit or run, and the form gives the filtered results. I don't want users to open the query and put in their criteria, I just want them to go to the form directly

When I click the form, I want the following to pop up at the same time so I can fill in the criteria:

Date
Vendor Number
Invoice Number
Check Received (this is a Yes or No field)

and then when I click submit or enter, the form gives me say 5 records that match this criteria.

Thanks a lot!!!

View 1 Replies View Related

Use 1 Query For Two Different Criteria In A Form?

Nov 10, 2006

Hi,

I have a form that has 4 different search options (all of them are independent of each other).

I'd like to use 1 query to pull the results without having a write 4 different queries for each criteria in the form.

Any ideas r welcome. Thanks.

View 2 Replies View Related

Get Query Criteria From Form.

Aug 14, 2007

I have a macro that runs 2 queries, they both have criteria that needs to be passed over. how can i do this? I currently have it prompt but how do i get it to pull from the form the macro trigger is in? I also have a report that runs from a query in that macro also. i dont' want the user to have to enter anything since the critereia is in the form.
thanx

View 4 Replies View Related

Multi Criteria Form Search?

Aug 17, 2007

Hi all:)

Has anyone ever come across an example of a form where you can carry out a multi criteria search which not only displays the results on a subform but when you select an item from that subform the details can be displayed in text boxes etc on the main form.
I have tediously searched this forum and the web but all search examples only display on a subform only, is it even possible if so has anyone found any examples or how would I go about achieving this

Thanks Jackie

View 3 Replies View Related







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