Auto-Fill fields on a Form with specific info

jr365

New member
Local time
Today, 14:11
Joined
Sep 28, 2009
Messages
1
In Access 2003, I created 2 tables; FILE LOCATOR (Fields are File Number, File Name, and Box Number) and BOX LOCATOR (Fields are Box Number and Shelf Number).
I want to create a Form(or Query in Form Format) so that when I type in a File Name, the File Number, Box Number and Shelf Number fields in the form fill in automatically.
I have been trying to accomplish this for a week, (even bought Access 2003 for Dummies) and cannot figure it out....Help would really be appreciated....Thank you..
 
Hi jr365.
First, welcome to the forum!

It sounds as though you will need an ubound form with a textbox (where the user will enter the filename) and maybe a button to perform the search.

By "perform the search", I mean the code on the button would insert the filename into a sql string.
You would then need a subform on your main form to display the results.

The recordsource of the subform would be set to the sql string.
Then the subform would be requeried, showing you the results.

Also, be advised: It is not good practice to use spaces or special character in object and field names.
 
Actually, after thinking about it a bit. It's even simpler.

You will have your main form with the search box and a button.
On that form is a subform. The recordsource of the subform is something like this:
Code:
SELECT Files.*, Boxes.ShelfNumber FROM Boxes INNER JOIN Files ON Boxes.BoxNumber=Files.BoxNumber WHERE (((Files.FileName) Like "*" & Forms!frmSearch!txtFileName & "*"));

The button on your main form simply requeries the subform.
 

Attachments

Users who are viewing this thread

Back
Top Bottom