473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Multiple Query text boxes on a single form - MS ACCESS 2003

Please, i don't know about programming i want to learn. I am creating a motor vehicle database and i need three text boxes on a single form for carrying out queries. The text boxes are: (VIN) (Begin Date) (End Date), so the user can query either by VIN or by Begin Date End Date.

How may i do this, or is there any code that can be customised to suite my need?

I will appreciate your response.
Feb 14 '08 #1
1 1507
sierra7
446 Expert 256MB
Joseph
If you don't know about Access or programming then the best thing is to start by reading the Help within Access.

You need to look-up topics on;-
About Tables
Create a Table
About Forms
Create Form
About Filters
Applying a Filter

They will give you a good start on how and why to do things. The topics are better illustrated than an explanation that can be given here.

If I have mis-understood your capabilities and you don't want your users to learn to Filter By Form to apply a filter, then you will need to create the three text boxes in the Header area of your form.

You will need three public string variables, lets call then sVIN, sBegin, & sEnd

in the After_Update event of txtVIN you need something like
Expand|Select|Wrap|Line Numbers
  1.  If Me.txtVIN= "" Then 
  2. sVIN = "[VIN] <0"
  3. Else
  4. sVIN = "[VIN]= '" & Me.txtVIN & "'"
  5. EndIf
  6.  
  7. DisplayData
  8.  
Have assumed VIN is alpha-numeric
In the After_Update event of txtBeginDate you will need
Expand|Select|Wrap|Line Numbers
  1.  If Me.txtBeginDate = "" Then 
  2. sBegin=""
  3. Else
  4. sBegin = " and [BeginDate] =#" & Me.txtBeginDate & "#"
  5. EndIf
  6.  
  7. DisplayData
  8.  
You will need a similar statement in the After_Update event of txtEndDate and it is presument that the field nmes of your database are [VIN], [BeginDate] and [EndDate]
You will need a module called DisplayData which will be like;=
Expand|Select|Wrap|Line Numbers
  1.  Private Sub DisplayData() 
  2. Dim strCriteria as String
  3.  
  4. strCriteria = sVin & sBegin & sEnd
  5. Me.Filter = strCriteria
  6. Me.Filter = On
  7.  
  8. End Sub
  9.  
Let's know how you get on

S7
Feb 20 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access...
3
by: rquinnan | last post by:
Good Evening all, I would greatly appreciate any assistance on this Access 2003 quandary I'm in. And I do apologize if this has been answered somewhere else, I didn't see one that addressed my...
6
by: Ralph2 | last post by:
Some time ago with a lot of help from this group I made a reasonably successful database to keep track of our shop drawings. However the searching mechanism is too complicated for the occasional...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
4
by: DeanL | last post by:
Hi Guys, I need some help creating a query that is going to take between 1 and 10 parameters. The parameters are entered on a form into text boxes that may have data or be empty. Is there a...
8
by: fonzie | last post by:
Is it possible to have a data entry form where the information is stored in several different tables (5 or 6)? I have an inventory database where Table1 stores all of the data common to all...
4
by: teknoshock | last post by:
I have created a page with multiple drop down boxes, all populated with the same options. My problem is, for 12 dropdown boxes and 40 choices per box, I end up with a massive file. Also, if I...
10
by: Gerhard | last post by:
Hi, all I run into the same problem on Access 2000 and 2003. Hopefully someone can replicate it – or not. 1. Create an unbound form – call it Form1. 2. Insert two unbound text boxes –...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.