473,394 Members | 1,956 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,394 software developers and data experts.

How to link a Listbox and a Subform?

Hello, I have a Listbox on a form that was made with fields from a Query. I have also created a subform on the same form page, which I would like to link the two, so that whatever records are selected on the Listbox are also shown in the subform.

The listbox is a multiselect listbox FYI. The reason why I would like to do this is because I am trying to extra certain fields from the Listbox to do other things such as a =Sum of one of the fields, however I know how to do this for a subform but not for a listbox.


Thanks guys! Please let me know if you need additional information!
May 19 '18 #1

✓ answered by PhilOfWalton

My approach would be to have a main form based on clients.
A continuous subform based on appointments (FrmSubAppts)
A second continuous subform based on Treatments. (FrmSubTreats)
As you select the current record in the (FrmSubAppts) this requeries the (FrmSubTreats) showing the treatments for that appointment.

Below is the sort of thing I use



The main form would be your client
The second form shows various pledges made by a donor (Appointments), and by clicking on a record, the third form shows the payments made (Treatments)

Hope this may give you some inspiration

Phil

4 2253
PhilOfWalton
1,430 Expert 1GB
I may be wrong, but I don't think you can.
Assuming your subform is a continuous form (actually it doesn't matter if it isn't) you can only select one record at a time. It is easy to get to a single record from your list box, but, I can't see how selecting more than one item from a multiselect list box can work

Phil
May 19 '18 #2
Hi phil, in the database I have, the form page I am creating is a 'Create Appointment' form, where the user creates an appointment for a client, and then assigns multiple or only 1 treatment per appointment.

In order to assign multiple Treatments to 1 AppointmentID, I created a table seperate from entities Treatment and Appointment, called TreatmentLog, which allows the user to assign multiple TreatmentID's to a AppointmentID, so that when viewing the Appointment, the subform shows multiple Treatments for that Appointment. (I know this is very very confusing).

I wanted the Listbox to be able to select the Treatments in a more user friendly way, and have the Subform hidden, but just have it hidden so I can do functions such as an =Sum for the duration or price, as I am familiar with how to do this for a subform but not for a list box.


If this is not possible that is no worries, but thank you for the resposne anyway Phil!.
May 19 '18 #3
PhilOfWalton
1,430 Expert 1GB
My approach would be to have a main form based on clients.
A continuous subform based on appointments (FrmSubAppts)
A second continuous subform based on Treatments. (FrmSubTreats)
As you select the current record in the (FrmSubAppts) this requeries the (FrmSubTreats) showing the treatments for that appointment.

Below is the sort of thing I use



The main form would be your client
The second form shows various pledges made by a donor (Appointments), and by clicking on a record, the third form shows the payments made (Treatments)

Hope this may give you some inspiration

Phil
May 19 '18 #4
Thank you phil the information you have provided has helped me to do what I needed to do!
May 19 '18 #5

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

Similar topics

2
by: chrisM | last post by:
Hi, Hope someone can help me. I have the following setup in an Access database A master form 'Customers' in 'Single Form' view that has a RecordSource of 'myCustomerTable' CustomerCode...
3
by: Nicolae Fieraru | last post by:
Hi All, I have a problem and I can't figure out how to solve it. My database has three tables: tblCustomers, with CustomerId and CustomerName tblProducts, with ProductId and ProductCode...
4
by: Joe | last post by:
Hi all, I haven't worked with Access in a LONG time and was hoping someone can help me with the following issue: I have 3 tables (STUDENTS, LANGUAGES, and STUDENTS_LANGUAGES). The schemas...
6
by: Vinayak | last post by:
Hi all, I have a many to many relationship that I want to present in a form/subform combination. The tables are Book, Book_Author_Link and Author. The main form is based on the table Book. How...
2
by: John | last post by:
Hi, I have two tables, one for customers and the other for payments made. I have forms for inputing/editing records in both. I have a main form with an implanted subform which shows payments made...
1
by: NBruch | last post by:
Ok let me explain what im trying to do: i need a combo box which needs to be linked to a listbox (or combo box doesnt matter which really) then the listbox should bring up the record in a...
2
by: mnms | last post by:
Hi, I'm trying to create an "overview" form. And I haven't been able to figure out how to get Access to do what I want yet. Basicly what I want, is to populate a subform based on a field...
5
by: John Torres | last post by:
I am trying to link second subform base on the 1st subform. I’ve read several threads and it’s just look too complicated for me (sorry I’m a newbie). I want to link shipping information (2nd...
0
by: 20028431 | last post by:
I have a main form called ’frmIssues’ which contains 2 subforms ‘sbfmLog’ and ‘sbfmLogNote’ frmIssues is bound to table ‘tblIssues’ and has fields IssueId (PK- Autonumber), Title (txt), DateOpened...
5
by: Lance James | last post by:
I have a main form containing a subform. The main form is not bound to a table. On the main form you select from a combo box. This updates the value in a hidden textbox on the main form with the...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.