John W. Colby
jwcolby at colbyconsulting.com
Thu Jan 27 11:13:07 CST 2005
In order to be able to reference three columns in code, you must set column count to 3. If you don't want any given column displayed, set the width of that column to zero. If you only have column count = 2 then you can only reference two columns (0 and 1) in the cbo.column(x) syntax. It sounds like you have column count set to 2. John W. Colby www.ColbyConsulting.com Contribute your unused CPU cycles to a good cause: http://folding.stanford.edu/ -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tom Bolton Sent: Thursday, January 27, 2005 11:45 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] RE: A2k2 combo boxes / rowsource hassles Neal and Gustav - many thanks for quick replies! .Column(0) contains a value for the column [Alias], .Column(1) contains a value for the column [FieldName], alas .Column(2) returns NULL every time! I checked the query is valid, and it returns data for all 3 columns... Andy, John - many thanks also I'm not wanting the combo to display the three columns, just wanting to display one column and have associated data with that column (e.g. the other 2 columns) - the combo is displaying a friendly alias, but by using the .Columns(x) syntax I can (or can't, as the case is) get at the other info. Cheers! Hope this makes sense, BTW... Tom -----Original Message----- From: Neal Kling [mailto:nkling at co.montgomery.ny.us] Sent: 27 January 2005 16:30 To: Access Developers discussion and problem solving Subject: RE: [AccessD] RE: A2k2 combo boxes / rowsource hassles Did you remember that the Columns property is Zero based? .Column(0) = first column .Column(1) = second column etc. Neal -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Tom Bolton Sent: Thursday, January 27, 2005 11:23 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] RE: A2k2 combo boxes / rowsource hassles Hi guys I have a problem with setting the rowsource property of a combo at runtime - I'm binding it to the SQL query shown below: SELECT tblAdmin_ColumnLookup.Alias, tblAdmin_ColumnLookup.FieldName, tblAdmin_ColumnLookup.[DataType] FROM tblAdmin_SQLData INNER JOIN tblAdmin_ColumnLookup ON tblAdmin_SQLData.ID = tblAdmin_ColumnLookup.SQLID WHERE tblAdmin_SQLData.ReportID = 5 AND tblAdmin_ColumnLookup.IncludeInTemplate=True The first 2 columns are there using myCombo.Columns(x), but the third... nowhere to be seen. I'm tearing my hair out here!! Any help appreciated, TIA Tom Tom Bolton Systems Developer (I.T.) Donns Solicitors Tel: 0161 834 3311 Fax: 0161 834 2317 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com