Search results

  1. E

    Using a form to enter criteria for a query

    Do not use embedded spaces in the name of objects on the form. Remove the spaces in the combo box name and use Forms!VendorForms!VendorNameComboList in the criteria of the query on which the report is based. Before running the report, make sure the VendorForms form is already open and a vendor...
  2. E

    Retrieving the very last entry

    Type/paste this in the SQL View of a new query and run the query. SELECT TOP 1 [desc] FROM [Pets] ORDER BY [ID] DESC; Note: The final DESC stands for Descending, not the field name [desc]. ^
  3. E

    iif statement to read fields from form not returning values

    The IIf() function takes three arguments: IIf(condition, truepart, falsepart) You can put each criterion in a new column in the query grid like this (using the correct field name):- ----------------------------------- Field: IIf([Forms]![frmFindInvoices]![ChkInvNo]=True...
  4. E

    Data Type Mismatch in Query Criteria????

    Try this:- Query1: Src: Table1 joined Table2 ID (Type Text) Title (Type Text) Remarks(Type Text) Formatted: FormatTitle([title],[Remarks]) Expr1: InStrRev(FormatTitle([title],[Remarks]), "~") ^
  5. E

    Help Coding Parameters for Queries

    Jon K's sample may help. http://www.access-programmers.co.uk/forums/showthread.php?t=103312 ^
  6. E

    Problem with IIF statement on a Query by Form

    I assume [Year] is a numeric field. Try these criteria in two new columns in the query grid in query Design View: - - - - - - - - - - - - - Field: [Year]<=[Forms]![QBF_Form]![WhatLatestYear] Or IsNull([Forms]![QBF_Form]![WhatLatestYear]) Show: uncheck Criteria: True - - - - -...
  7. E

    SELECT COUNT(*) INTO '" & strCounter & "'

    In VBA, you can use the DCount() function. Dim lCounter As Long lCounter = DCount("*", "TableName or QueryName") ^
  8. E

    Finding the lowest average

    I can see two problems:- 1. Access doesn't like 'selecting from a select statement'. Once the query is saved, Access will change some brackets into square brackets and add some extras. 2. The DESC returns the city with the highest instead of the lowest average. The simplest statement is:-...
  9. E

    How to Query list of criteria

    Since the values are in the second table, you don't need to put them in the criteria. You can add the second table to the query in query design view. Then link the two tables by dragging the numeric field from the master table to the numeric field of the second table. Access will draw a line...
  10. E

    Setting query criteria to be 'blank' depending on the criteria of a combo box

    Download Jon K's sample database from the link in my previous post. It does what you described. ^
  11. E

    Setting query criteria to be 'blank' depending on the criteria of a combo box

    Try this criteria in a new column in the query grid, using the correct form name and combo box name: - - - - - - - - - - - - - - - - - Field: IIf([Forms]![FormName]![ComboBoxName]="Open", [Actual Completion Date] Is Null, IIf([Forms]![FormName]![ComboBoxName]="Overdue", [Actual Completion...
  12. E

    Help with Like & "*" parameter...

    This thread may help. http://www.access-programmers.co.uk/forums/showthread.php?t=115783 ^
  13. E

    Parameter query - allow user to select all

    I'm glad it works for you. I wrote to point out what I saw because the title of the thread says "Parameter query - allow user to select all" ^
  14. E

    treating Text like numbers

    SELECT * FROM [TableName] ORDER BY Val([TextFieldName]); ^
  15. E

    Parameter query - allow user to select all

    Thanks for posting the criteria you used. But there is a limitation in your criteria. In [Division Name] = IIf([Division Name?] Is Null Or [Division Name?]="all", [Division Name], [Division Name?]) when the condition is true, [Division Name]=[Division Name] will leave out all the Null values...
  16. E

    Combo box to also select all options

    Try this criteria:- WHERE ((([CallsEntered].[Date Entered]>=[Forms]![frmServiceCalls]![txtStartDate] Or [Forms]![frmServiceCalls]![txtStartDate] Is Null)=True) AND (([CallsEntered].[Date Entered]<=[Forms]![frmServiceCalls]![txtEndDate] Or [Forms]![frmServiceCalls]![txtEndDate] Is Null)=True)...
  17. E

    Viewing only those data with value

    Put True in the criteria. ^
  18. E

    Using Iif and Between

    Expr1: IIf(Price<=5,"A", IIf(Price<=10,"B", IIf(Price<=15,"C", "D"))) If Price may be Null, Expr1: IIf(IsNull(Price),Null, IIf(Price<=5,"A", IIf(Price<=10,"B", IIf(Price<=15,"C", "D")))) ^
  19. E

    Help on Date

    It sounds like Access is matching [Lic_Exp] and the criteria as if they were text strings rather than dates. Try using the DateAdd() function instead of adding 365.25 days. Lic_Exp: DateAdd("yyyy", 1, [Lic_Date]) Note: Adding 365.25 days to a Date is actually adding 365 days and 6 hours to...
  20. E

    Received Dates Query

    You can add up the number of IsDates and change its sign from negative to positive:- Num: -( IsDate([Recd Date 1])+IsDate([Recd Date 2])+IsDate([Recd Date 3])+IsDate([Recd Date 4]) ) ^
Back
Top Bottom