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

Access table search from form

P: 1
Ok ill make this easy. lets say I have to tables "users" "computers" and they are related. Now I have a form where I want to be able to type a userID in a textbox and click a button and it will search the "users" table for the userID and populate the form (which has other textboxes) with information that corresponds to that userID from both tables.

I cannot for the life of me remember how to code this. Any help would be awesome.
Oct 17 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 2.5K+
P: 3,532
First, if you haven't already done so, create a query that includes the two tables. Next, create a form based on this query, including all the fields you want displayed. Then simply:

Add a combo box to your form. The Combobox Wizard will pop up

Select "Find a record based on the value I selected in my combobox."

From the query the form is based on, click on the field you're searching by (your ID field) to move it to the right side.

Hit Next.

Size the column appropriately.

Hit Next.

Name the combobox.

Hit Finish.

Now you can drop the combobox down and scroll down to the item to search by, or you can start to enter the item, and the combobox will "autofill" as you type. Hit <Enter> and the record will be retrieved.

Welome to TheScripts!

Linq ;0)>
Oct 18 '07 #2

Post your reply

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