RE: Using text in a Form to run a Query



I tried converting your SQL from = to IN but didn't have any luck even when
putting quotation marks and commas in the form's text field.

What you could try is putting multiple fields in the form, say 4 of them,
and run it. The SQL would look something like below.

SELECT T.[Trouble_Ticket_#]
FROM [Table] as T
WHERE
T.[Trouble_Ticket_#] = [Forms]![Retrieve Reviewed Records
Form]![Tickets1]
OR T.[Trouble_Ticket_#] = [Forms]![Retrieve Reviewed Records Form]![Tickets2]
OR T.[Trouble_Ticket_#] = [Forms]![Retrieve Reviewed Records Form]![Tickets3]
OR T.[Trouble_Ticket_#] = [Forms]![Retrieve Reviewed Records Form]![Tickets4]
;
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"JWPosey" wrote:

I run a query every day against our company database to pull in specific
information. I then store this information locally in my Access db. To save
on space, once I'm done reviewing a record, I delete some of the fields to
keep the db space low.

My problem is that in the future I may have to retrieve these fields. I
keep the ticket number in the Access db the same as our company database
(they both have the exact same format). I create a form so that tickets can
be inputted and then try to retrieve them from the company db, but it doesn't
work if I try to retrieve multiple ticket numbers. In the form I put an "OR"
between the tickets so that it is included in the query. Here is what my
query SQL looks like:

SELECT [Table].[Trouble_Ticket_#]
FROM [Table]
WHERE ((([Table].[Trouble_Ticket_#])=[Forms]![Retrieve Reviewed Records
Form]![Tickets]));
.



Relevant Pages

  • Re: Which identity?
    ... > Some postings I read suggested using MAXto retrieve the inserted record ... > each of these 3 SQL features? ... Another way to do it if using the .AddNew method on a Jet based ADO ... Dim rsTest As ADODB.Recordset ...
    (microsoft.public.access.queries)
  • Re: White Paper on How MSAccess interacts with SQL Server Back End
    ... these keys to retrieve the other fields from the tables by group of 10 rows. ... or with VBA functions that Access cannot translate directly into T-SQL ... Sylvain Lafontaine, ing. ... my SQL 2000 db using ACC2003 as the front end via linked tables. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: VS.NET 2003, ADO.NET 1.1 and Access 2000: Getting a Concurrency violation
    ... I am using an Access update query, with parameters, for the ... Then my app goes against a SQL ... OleDbDataAdapter that I use to retrieve the original table from the ... So your named parameters for SQL Server suddenly become anonymous ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: VS.NET 2003, ADO.NET 1.1 and Access 2000: Getting a Concurrency violation
    ... Then my app goes against a SQL ... Server 2000 database, retrieves other data and updates about 500 ... OleDbDataAdapter that I use to retrieve the original table from the ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Linq. Select.
    ... The SQL way is to order by a GUID and select the top 10 rows. ... Unfortunately, SQL is made to retrieve the rows you specify, not just ... Lead developer of LLBLGen Pro, the productive O/R mapper for .NET ... My .NET blog: http://weblogs.asp.net/fbouma ...
    (microsoft.public.dotnet.languages.csharp)