Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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 May 22nd, 2004, 05:26 AM
Authorized User
 
Join Date: Jun 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Another ComboBox lookup query!

Hi All you experts, anyone help me with this?

I have a data entry form with a combo box cboIndustry filled by the SQL
SELECT Industries.IndustryID, Industries.IndDescription FROM Industries;
The field IndustriesID contains multiple entries in each row e.g. Mining of coal, extraction of Peat
This makes the look up function complex, so I am needing a lookup table to be triggered by the not in list property.
Private Sub cboIndustry_NotInList(NewData As String, Response As Integer)
DoCmd.OpenForm "frmIndustryLookup",,,,,acDialog, NewData
Response = 0
End Sub
The form IndustryLookup has an unbound combo box cboIndustLook, row source
SELECT Industries.IndustryID, Industries.IndDescription FROM Industries WHERE IndDescription like "**";
frmIndustryLookup has the following code attached:
Private Sub Form_Load()
cboIndustLook.RowSource= "SELECT Industries.IndustryID, Insustries.IndDescription FROM Industries WHERE IndDescription like "*" & OpenArgs & "*"
cboIndustLook.Requery
cboIndustLook.SetFocus
cboIndustLook.Dropdown
End Sub
cboIndustLook has the following code
Private Sub cboIndustLook_Change()
Forms![Patient information].cboIndustry = cboIndustLook.Column(2, cboIndustLook.ListIndex)
DoCmd.Close
End Sub
On entering an industry not on list item the code functions as far as opening the frmIndustryLook and selecting possible matches for the data entered in [Patient information].cboIndustry but at that point it fails to set this combo box to the item you select in the frmIndustryLook
Any Suggestions???
Thanks Barry
 
Old September 28th, 2004, 12:08 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There is a question to be asked like is the ...plugged. There it goes:
on the properties window of the combo box cboIndustry is the limit to list property: NO.
Regards P.






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fill a combobox with the items from a query MacDevv C# 1 August 21st, 2006 07:59 AM
lookup using VB karebear VB How-To 1 August 2nd, 2006 04:32 PM
Is it possible to put a combobox in a query aparaiba BOOK: Access 2003 VBA Programmer's Reference 1 March 15th, 2006 05:51 PM
Bound ComboBox Database Query dougontour VB.NET 2002/2003 Basics 5 April 20th, 2005 02:11 AM
Lookup Tables mossimo Access 4 December 5th, 2003 11:27 AM





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