473,406 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Query column names as LIST BOX content

12
Hello,
I have a Main Form named DATA and a Subform named SPEC. A query named DATA QUERY saves all the data from both the forms.

I am making a new form named FORM1 which has a LIST BOX named LIST1. I use LIST BOX WIZARD to create the same. I use QUERY to populate this list box.

The problem is that LIST1 is populated with the data of the QUERY and not the COLUMN NAMES of the DATA QUERY.
Kindly help.
Thanks in advance.
Jan 18 '13 #1

✓ answered by TheSmileyCoder

You need to set the listbox' Row Source TYPE property to FIELD LIST. That will give you the column names instead of the data.


Using the same query for both your form and your subform sounds "off" to me. Do you have a good reason to do so?

5 4068
TheSmileyCoder
2,322 Expert Mod 2GB
You need to set the listbox' Row Source TYPE property to FIELD LIST. That will give you the column names instead of the data.


Using the same query for both your form and your subform sounds "off" to me. Do you have a good reason to do so?
Jan 18 '13 #2
Anjani
12
Thanks for your swift reply.

Same query for Main and Sub Forms is the demand of my project.

My Query has 15 Columns in total. When i set the Row Source Type property to FIELD LIST (Shown in Untitled1.jpg), it still shows 15 columns and value of each column is converted into Column Names (Shown in Untitled2.jpg).



Attached Images
File Type: jpg Untitled1.jpg (38.5 KB, 1590 views)
File Type: jpg Untitled2.jpg (41.3 KB, 1659 views)
Jan 18 '13 #3
TheSmileyCoder
2,322 Expert Mod 2GB
I just knocked together a sample on my end to make sure I remember correctly, and sorry to say it, but it works as intended on my end. You must have something else going on with the listbox (code for example) or the query.
Jan 18 '13 #4
Anjani
12
Oops!!! I made a boo boo... Column Count was set to 15 and hence i was facing this problem.. thank you TheSmileyCoder, as your confidence made me dig harder into its properties.

But the problem is that all Column names are transferring from List1 (List Box 1) to List2 (List Box 2) other than the first column name i.e. Project Number. Please help
Jan 18 '13 #5
TheSmileyCoder
2,322 Expert Mod 2GB
I Presume you mean when you want to "transfer" the columns? Either way that is a "new" question and should be in a new thread, to keep things seperate.

When you post your question, it would be a good idea to include the same screenshot, as well as any code you have allready tried for the button(s). The SQL behind the listbox query might also prove usefull, so why not include that from the start :)

Also the images are a bit hard to view, next time zoom in on the important parts :)
Jan 18 '13 #6

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

Similar topics

2
by: Joe Gazda | last post by:
I'm a relative newbie to PHP, but have been able to put together some PHP code to generate a CSV/XLS file from a Query result. Now, I would like to include custom column names instead of the MySQL...
1
by: noor | last post by:
Hi I have been working since 2 days to device a method to export sql table into csv format. I have tried using bcp with format option to keep the column names but I'm unable to transfer the file...
2
by: Piotr Kurpiel | last post by:
Hello, I am using MS Access 2003 with VBScript. I have quite strange column names which are: 1,2,3,4,etc... Data Types of the columns are Yes/No and formats True/False. The first thing I want to...
7
by: | last post by:
Need help finding simple way to retrieve a fields (or columns) collection from a Dataset without filling it first.
1
by: maksr | last post by:
Is this a bug in Db2 on iSeries V5 R3? The following query should work: CREATE TABLE qtemp.t03 AS ( SELECT 1 AS foofoo_s , CASE WHEN 1=1 THEN 1 ELSE 2 END AS foofo FROM sysibm.sysdummy1 )...
3
by: beary | last post by:
I picked up the following code to take a mysql table to an excel file. What do I need to do to it to make the first excel row be the column names, rather than the first record? $query = "SELECT *...
1
by: christianlott1 | last post by:
I want to provide users with an interface to create a custom merge (all in Access, not Word). User will put in a set of brackets ("<>") in a memo field and when they click the merge button it will...
4
by: mailsumit | last post by:
I would like to know the SQL statement for displaying only the column names of a particular table. For eg. if I have a table by the name DETAILS and it has three columns FIRST_NAME, LAST_NAME and...
1
by: bugs2bugs | last post by:
Hello, We're using SQL Server 2000 and Query Manager (not Visual Studio). When your query results are returned, the column names are displayed at the top, but this information is NOT available for...
2
by: Shisou | last post by:
Hello all, I'm trying to create some reports and I've run into a bit of a tricky query... I need 1 query that will basically return 2 columns... column1 will be a list of certain column names...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.