473,406 Members | 2,467 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.

Problems loading a listbox rowsource from code

I am having some real trouble getting a listbox rowsource to load
properly. The listbox is actually on a subform. My main form has
several command buttons that change the MASTER_SUB_FORM object source
to the specific sub form needed by the end user. When designing the
sub form i used the querybuilder to create an SQL statment to define
the listbox values.

****
RowSource SQL Statement
****

SELECT [CAN_LAST] & ", " & [CAN_FIRST] AS Name,
CANDIDATES.INTERVIEW_TIME AS [Scheduled At] FROM CANDIDATES WHERE
(((CANDIDATES.EVENT)=FORMS!SELECT_INTERVIEW!SELECT _INTERVIEW_EVENT))
GROUP BY [CAN_LAST] & ", " & [CAN_FIRST], CANDIDATES.INTERVIEW_TIME
ORDER BY CANDIDATES.INTERVIEW_TIME;
As you can see, I use an object(combobox) as criteria
(Forms!SELECT_INTERVIEW!SELECT_INTERVIEW_EVENT)

When i only have the subform open this works fine. However, when i try
and load the subform from the main form I get a query prompt that says
Forms!SELECT_INTERVIEW!SELECT_INTERVIEW_EVENT.

What would cause this? Is there a way around this? I would really,
greatly appreciate any advise from you pro's

Nov 13 '05 #1
4 4663
The Form displayed in a Subform control is neither "Open" nor is it in the
Forms! collection. You must refer to it as the .Form property of the Subform
control.

Larry Linson
Microsoft Access MVP

"Corey" <co**********@yahoo.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
I am having some real trouble getting a listbox rowsource to load
properly. The listbox is actually on a subform. My main form has
several command buttons that change the MASTER_SUB_FORM object source
to the specific sub form needed by the end user. When designing the
sub form i used the querybuilder to create an SQL statment to define
the listbox values.

****
RowSource SQL Statement
****

SELECT [CAN_LAST] & ", " & [CAN_FIRST] AS Name,
CANDIDATES.INTERVIEW_TIME AS [Scheduled At] FROM CANDIDATES WHERE
(((CANDIDATES.EVENT)=FORMS!SELECT_INTERVIEW!SELECT _INTERVIEW_EVENT))
GROUP BY [CAN_LAST] & ", " & [CAN_FIRST], CANDIDATES.INTERVIEW_TIME
ORDER BY CANDIDATES.INTERVIEW_TIME;
As you can see, I use an object(combobox) as criteria
(Forms!SELECT_INTERVIEW!SELECT_INTERVIEW_EVENT)

When i only have the subform open this works fine. However, when i try
and load the subform from the main form I get a query prompt that says
Forms!SELECT_INTERVIEW!SELECT_INTERVIEW_EVENT.

What would cause this? Is there a way around this? I would really,
greatly appreciate any advise from you pro's

Nov 13 '05 #2
Larry,

Im sorry but im totally drawing a blank. Can you help me a little
here? By refering to it as the .form property what exactly would i be
doing. Thanks for your help!

Nov 13 '05 #3
REad this article... it explains it all.

http://www.mvps.org/access/forms/frm0031.htm

Nov 13 '05 #4
So i changed up my criteria a little and the form at least loads now
without the query prompt. But now the listbox doesnt load.
Appearntly, I am still missing something, any ideas? Should I be
creating the rowsource from code or can i still use the query builder
to build the SQL statement from the list box properties box?

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike Top | last post by:
I want a listbox to position to a letter provided by the user. Normally, when the user keys a letter, the listbox positions automatically to the first entry starting with that letter in the first...
7
by: Colleyville Alan | last post by:
I have an app in which users are displayed a list of mutual fund from which they can choose. There is a listbox embedded in a two-tabbed notebook control. When the form is initally opened, the...
9
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have...
3
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
6
by: Deano | last post by:
I needed to have a listbox populated by locations which are stored in tblLocations. However I wanted an "All locations" entry to be at the top of the listbox. This is not in the tblLocations. The...
13
by: Gittyup | last post by:
Help please, We have a form, based on a query, that contains a listbox. The contents of the listbox are based on the results of the query. When the form is opened, the user selects an item...
1
by: ANDRESUK | last post by:
All I have a listbox in a form footer. When the form footer is visible the listbox requeries fine but when I turn the form footer visible=false the listbox does not requery at all. What I am...
3
by: ML | last post by:
I have used Allen Brown's technique for filling a listbox on a form with the names of files in a certain disc folder. It works well. I am now giving the user the option to print the form...
6
by: BerkshireGuy | last post by:
On an unbound form, I have a combobox called 'cboproducttype' and a text box called 'txtamountappliedfor'. I have an Add button that I would like the user to be able to hit once a product and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.