By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

In a form search for value to fill in field

P: 10
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
Share this Question
Share on Google+
6 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
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

P: 10
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

P: 10
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
Expert Mod 10K+
P: 14,534
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

P: 10
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
Expert Mod 10K+
P: 14,534
Thanks ill leave it then

Nathan
No problem.
Mar 14 '07 #7

Post your reply

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