A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Populate Textbox



 
 
Thread Tools Display Modes
  #1  
Old June 2nd, 2010, 03:51 PM posted to microsoft.public.access.forms
lfc
external usenet poster
 
Posts: 12
Default Populate Textbox

Hi,

I have a table with part numbers and locations. There are multiple
locations per part number. I would like to populate a listbox with a
filtered list of the locations for the part number shown on my form. I'm not
very good at vba and have been looking all over for code, but can't find
anything suitable.

Thanks
  #2  
Old June 2nd, 2010, 04:03 PM posted to microsoft.public.access.forms
Golfinray
external usenet poster
 
Posts: 1,597
Default Populate Textbox

You have multiple locations per part number. So first, let's get your form
set up correctly. When you have a one-to-many format (one salesman, many
products or one part number, many locations) you need a form and subform. The
Mainform would be for your part numbers (the One.) The subform for your
locations (the many.) So it might help if you set that up first. Then it is a
simple combo box you need to search. Put a combo on the mainform. Allow the
combo box wizard to set that up for you with your part numbers. Then right
click on the combo, go to events, go to the Afterupdate event, click the
button out to the right, open the code builder, and type:
Me.filter = "[locations] = """ & Me.combo# & """"
Me.filteron = true
The combo number will be listed, like combo10 or combo22
--
Milton Purdy
ACCESS
State of Arkansas


"LFC" wrote:

Hi,

I have a table with part numbers and locations. There are multiple
locations per part number. I would like to populate a listbox with a
filtered list of the locations for the part number shown on my form. I'm not
very good at vba and have been looking all over for code, but can't find
anything suitable.

Thanks

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.