473,385 Members | 1,838 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,385 software developers and data experts.

In a form search for value to fill in field

Hiya,
I am making a system to book plane flights as a University Level 1 project, In the booking form i have, i wish to be able to search for a customers ID number to fill in this field if the customerID number is not known, how would i go about making the form so if you need to search for the customerID by entering known values and outputting the end result into the CustomerID field in the original booking form, customers are stored in a seperate table to booking information. Thanks in advance.
Mar 13 '07 #1
6 1741
MMcCarthy
14,534 Expert Mod 8TB
Hiya,
I am making a system to book plane flights as a University Level 1 project, In the booking form i have, i wish to be able to search for a customers ID number to fill in this field if the customerID number is not known, how would i go about making the form so if you need to search for the customerID by entering known values and outputting the end result into the CustomerID field in the original booking form, customers are stored in a seperate table to booking information. Thanks in advance.
Make the CustomerID a combo box and set it up as follows:

Column Count = 2
Column Widths = 0cm;3cm
Control Source = CustomerID
Row Source Type = "Table/Query"
Row Source = SELECT CustomerID, CustomerName FROM Customers ORDER BY CustomerName
Bound Column = 1

I had to guess at the query statement for the Row Source but you can correct it appropriate to your fields and table.

This will display the list of customers in alphabetical order and store the CustomerID of the selected customer.

Mary
Mar 13 '07 #2
Thankyou very much, I knew it was fairly simple to do but havnt done any access work in a couple of years, many thanks for the extremely quick solution, i may be back if i get stuck on anything else, thankyou very much :D
Mar 13 '07 #3
Actually is it possible that you can either input the customerID or use the drop down to select the customer? my Row source is;

Expand|Select|Wrap|Line Numbers
  1. SELECT Customers.CustomerID, FirstName+" "+SurName+" "+PostCode FROM Customers ORDER BY Customers.SurName; 
Thanks Nathan
Mar 13 '07 #4
MMcCarthy
14,534 Expert Mod 8TB
Actually is it possible that you can either input the customerID or use the drop down to select the customer? my Row source is;

Expand|Select|Wrap|Line Numbers
  1. SELECT Customers.CustomerID, FirstName+" "+SurName+" "+PostCode FROM Customers ORDER BY Customers.SurName; 
Thanks Nathan
Hi Nathan

You don't want to allow the users to input the customerID. As it is a foreign key it must already be present in the customer table or the relationship won't work. Restricting to the list is necessary in this case.

Mary
Mar 14 '07 #5
Hi Nathan

You don't want to allow the users to input the customerID. As it is a foreign key it must already be present in the customer table or the relationship won't work. Restricting to the list is necessary in this case.

Mary
Thanks ill leave it then

Nathan
Mar 14 '07 #6
MMcCarthy
14,534 Expert Mod 8TB
Thanks ill leave it then

Nathan
No problem.
Mar 14 '07 #7

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

Similar topics

7
by: Dave B | last post by:
Does anyone know of a program that will read a text file and fill in a web form with the contents of that file? We need to get about 3000 records (5 fields to each record) into a database owned by...
1
by: Matt | last post by:
Hi group, Here's a problem I've been trying to solve for the past several weeks. I have the standard WebBrowser object added to a form so it can access websites, and I have it load a default...
14
by: Oleg | last post by:
Hello there: I've been trying to create two different sets of required fields in one form and to use a radiobutton as sort of a switcher between these sets. In my HTML form there are two...
5
by: Codeman II | last post by:
Hi there, I am building a form where the user must upload a picture and fill in his details. Now I have a problem as all of this is on the same form. How will I be able to have the Browse...
9
by: Christopher Koh | last post by:
I will make a form which will search the database (just like google interface) that will look/match for the exact name in the records of a given fieldname. Any suggestions on how to make the code?
19
by: Alex | last post by:
Hello list This question has probably already been asked, but let me ask again I have a mysql database to which I connect with my php scripts. The database contains articles. Name, Unit_Price...
7
by: h7qvnk7q001 | last post by:
I'm trying to implement a simple server-side form validation (No Javascript). If the user submits a form with errors, I want to redisplay the same form with the errors highlighted. Once the form...
7
by: ero | last post by:
Is it possible to input values into a web form from an external source like a client-side javascript? There is a web site that I'm viewing where I have to enter 5 values in the form. 4 of the...
8
by: jd2007 | last post by:
Why the Ajax code below in ajax.js is causing my form not to work ? ajax.js: var a=0; var b=0; var c=0; var d=0; var e=0; var f=0;
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.