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

populating a forms based on part number

P: 1
I'm new to the forum, but am looking for help trying to populate several text boxes based on a drop down that will choose an asset number.

my Combo box is named GP, I will pick a number from this list and I want to do a GP_afterupdate() to populate description, make, model, sn, etc from a table called GP_Table with fields called description, make, model, sn, etc for the matching gp number.

I don't have a clue what to do. Can anyone help?
Aug 3 '07 #1
Share this Question
Share on Google+
3 Replies


BradHodge
Expert 100+
P: 166
Welcome to thescripts!

You could put this code in an AfterUpdate event of your combo box, or as the OnClick event of a button on your form...

Me.make= DLookUp ("[make]", "GP_Table", [gpNumber]= "Forms![YOUR FORM]![GP]"
Me.model=DLookUp ("[model]", "GP_Table", [gpNumber]="Forms![YOUR FORM]![GP]"
Me.sn=DLookUp ("[sn]", "GP_Table", [gpNumber]="Forms![YOUR FORM]![GP]"


and so on...

Another way to do it might be to just change the recordsource of your form after a gpNumber is chosen.

Good Luck!

Brad.
Aug 4 '07 #2

missinglinq
Expert 2.5K+
P: 3,532
Why not simply let Access do all the work? You may have done some of this already.

Create a form using your table/query as the Record Source.
Goto the Field List and drag the fields you want retrieved onto the form
Place a combo box on the form. When the Combobox Wizard comes up:

Select "Find a record on my form based on the value I've selected..."
Next
Select the appropriate identifying field to appear in the Combo box (Your asset number)
Next
Size the Combo box column
Next
Name the combo box
Finish

Now the user can use the dropdown arrow of the combo box to retrieve the data or simply start typing the identifying data in and the combo box will start to autocomplete the entry. When the correct entry is found hit <Enter> and the appropriate data should be retrieved.

Welcome to theScripts!

Linq ;0)>
Aug 4 '07 #3

P: 49
Good rsponse Missingl

Failing that why not put an an example of where you are up to on here in ZIP and Im sure one or two will make a little exple of the way out for you yo be anle to move on
G
Aug 4 '07 #4

Post your reply

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