RE: Using text in a Form to run a Query
- From: Jerry Whittle <JerryWhittle@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Jan 2008 14:24:01 -0800
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]));
- Prev by Date: Re: lost joins in frontend
- Next by Date: Re: query problem
- Previous by thread: Re: MS Access 2003 Query error
- Next by thread: Re: Using text in a Form to run a Query
- Index(es):
Relevant Pages
|