Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 5th, 2003, 12:00 PM
Authorized User
 
Join Date: Sep 2003
Location: Ipswich UK, , United Kingdom.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to MattLeek
Default Getting data from tables

Hello.
I am quite new at Access VBA and i am making a script where when you type the name of an item in to a box it comes up with all the people that are linked to it. There is a field in the people table which has a number the same as the ID of the item. Now to save them having to type in the ID number i want them to type in the name of the item, then find the ID of the item then call up the people related to it. I can do it all apart from finding the ID of the item they entered. Can anyone help?

Thanks, Matthew Leek

Matthew Leek
__________________
Thanks,
Matthew
 
Old October 6th, 2003, 04:00 PM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Matthew,

On your form, you have the person's name and a dropdown (combobox) next to it. On the combobox, you make the rowsource have two columns: the ID and the name of the item. Set the bound column property to column 1. Set the column widths to zero inches for column 1 and (say) two inches for column 2. Set the list width to the same width as column 2. This will make column 1 invisible (no item numbers will show because column 1 width was set to zero) and let people see only the item name (column 2) when they click on the dropdown.

When they choose an item name (column 2) from the dropdown, because the bound column is really column 1 (which is invisible), Access will store the item ID along with the person's name in your table.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old October 8th, 2003, 11:22 AM
Authorized User
 
Join Date: Sep 2003
Location: Ipswich UK, , United Kingdom.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to MattLeek
Default

Thank you for that. I got it working now.

Thanks Again

Matthew Leek




Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting data from link tables psnow1985 SQL Server ASP 0 March 27th, 2008 03:19 PM
how to compare tables data ramanadyv SQL Language 0 April 10th, 2006 04:38 AM
data from multiple tables keyvanjan Classic ASP Basics 1 January 24th, 2006 06:32 PM
Getting data from linked tables SoC Classic ASP Databases 2 October 13th, 2005 08:18 PM
Getting data from two tables pajer SQL Server 2000 8 September 30th, 2004 10:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.