By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

Listboxes with separate query in continuous form ?

P: 1
Hello everyone,
I have a specific need and i can't seem to find an answer.

What i wish to do: list activities in a continuous form, and in one column display for each row a listbox which rowsource query is based on another column value from the same row. Can it be done simply, and consider the rowsource like a bound field? At a larger scale, how can i access an specific (row) unbound field in a continuous form?

I have to admit that the best thing for me would be to create the whole continuous form through vba ... is that possible?

If what I want isn't clear, I can provide more precisions.
Thanks in advance!
Dec 3 '13 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,221
Unfortunately, unbound objects don't work well on continuous forms. When one is changed they all change.

You have two options. One is to put the list box in the header or footer. The other is to make your form a single form and make a sub-form to hold the detail data. Put a list box and the sub-form in the detail area of your main form.

In the sub-form, put some code in the On Current event to update the list box that is on the main form.

Jim
Dec 3 '13 #2

zmbd
Expert Mod 5K+
P: 5,287
jimatqsi: That's not really the whole picture.
I have several unbound forms and controls where'in the control will return a unique value in the details section, I even have one that will calculate the difference between the relative-prior record and the current record (yes that can change in positionals; however that's the desired result - I have another that spans based on PK's and FK's vs date). However, these types of controls are typically very difficult to create

pifpifpoufa:
You have two questions. Please only one per thread.

To get a different value, you will usually need a custom function.

For example, I have database that shows a different photo for each person (this was fun) in a continuous form.
I have a text control with the control source:
=fncPhotoIdLoc([people_photo],"photoid")
The function takes the information from the field [people_photo] and the directory location "photoid" finds the path (in this case realative to the current database location) and returns the full path to that photo.
This same function acts as the control source for my image control too (works in ACC2003 and ACC2010).
The report for this database does the same thing.

These controls are NOT editable

As for your specific need:
rowsource query is based on another column value from the same row. Can it be done simply, and consider the rowsource
Keep in mind that the CONTROL source is NOT the same as the ROW source. You will also have to have a REQUERY in the dependant control to get the ROW source in the dependant to update the available ROW source recordset when the value of the dominate control is changed.
There will be some additional difficulties with your form on loading in the form control values may not be set; thus, resulting in a null/invalid recordset which can cause the form to crash.
Dec 3 '13 #3

Post your reply

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