473,725 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

listbox bound to a main form

51 New Member
I don't know if I can explain my question clearly.
There're three tables as Scholars, Grants, ScholarWIthGran ts, the relationship between scholar and grants is 'many-to-many', and ScholarWithGran ts is the joint table.

A scholar form is created, as main form. a listbox as 'grantList' is embedded into this main form. The data source for grantlist is bound to the scholarID on the main form.

SELECT sg.ScholarID, sg.GrantID, sg.Title, sg.GrantRole
FROM ScholarsWithGra nts as sg
WHERE sg.StudentID = [scholars].[studentID]))

when the main form is on load, the grantlist displays the correct list for the first scholar. while using the navigation button at the bottom of the main form, the scholarID is moving on, but grantlist stays unchanged. don't know what event is with navigation button.

I understand I may use subform instead of listbox, and subform worked fine. But there're other purposes of using listbox, e.g. click on one listed records and others.

Please help... What shall I do for such a situation?
Thanks for any suggestions and helps........
Aug 8 '07 #1
2 1792
FishVal
2,653 Recognized Expert Specialist
I don't know if I can explain my question clearly.
There're three tables as Scholars, Grants, ScholarWIthGran ts, the relationship between scholar and grants is 'many-to-many', and ScholarWithGran ts is the joint table.

A scholar form is created, as main form. a listbox as 'grantList' is embedded into this main form. The data source for grantlist is bound to the scholarID on the main form.

SELECT sg.ScholarID, sg.GrantID, sg.Title, sg.GrantRole
FROM ScholarsWithGra nts as sg
WHERE sg.StudentID = [scholars].[studentID]))

when the main form is on load, the grantlist displays the correct list for the first scholar. while using the navigation button at the bottom of the main form, the scholarID is moving on, but grantlist stays unchanged. don't know what event is with navigation button.

I understand I may use subform instead of listbox, and subform worked fine. But there're other purposes of using listbox, e.g. click on one listed records and others.

Please help... What shall I do for such a situation?
Thanks for any suggestions and helps........
Hi!

When you browse through the records, each time a record has been populated form Current event is triggered. Here you can populate your Listbox with a relevant records.
Aug 9 '07 #2
anniebai
51 New Member
Hi!

When you browse through the records, each time a record has been populated form Current event is triggered. Here you can populate your Listbox with a relevant records.
Thanks a million.
It worked at the first try.
Aug 9 '07 #3

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

Similar topics

2
3676
by: Simon P | last post by:
Hello group, I'm in desperate need of help. Here goes : I have the following tables : CONTACTS (ContactID, FirstName, LastName, Company, etc.), SHOWS (ShowID, ShowDescription) and SHOWDETAILS (links the previous tables together so not to have a many-to-many relationship -- has the ContactID and ShowID fields). I have a main form with a couple of listboxes which are used for querying the CONTACTS table. The results populate bound fields...
6
2463
by: AAJ | last post by:
Hi all I have a listbox on a form. If I set its rowsource directly, and the query in the rowsourse returns no data, then the displayed listbox is empty (exactly as you would expect) However.... If I programatically set the rowsource, and the query returns no records then access completely crashes and switches its self off,
1
1596
by: Herr Lukas | last post by:
hello I'm from germany - 1 form bounded at 1 tableI with IDaqi and IDarbG, ok, it' works. - the form is kind endless, not surprising - in the detail-section I want to built 1 listbox its rowsource type query with select * from query23 where IDaqi=aqiID (the main-key from query23 its tableII and tableIII)
6
2876
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset a denormalized mirror of the database, but I'm not having much luck getting the selection logic down (I haven't found a 'hook' where I can access the listbox object as an object to set the listitem's selected property before it gets rendered).. ...
3
1653
by: PAPutzback | last post by:
I have a form that when it loads it fires off a second thread to load a datatable. This datatable contains a list of names and ids that the user may want to add to their criteria. So I have a button that once the thread completes it beccomes enabled and the datable gets bound to a listbox that shows up on the new form. But there is a delay, which I am guessing is when the listbox is preparing to paint itself with the bound data. Is...
7
4531
by: Dave | last post by:
Hi all, After unsuccessfully trying to make my own dual listbox control out of arraylists, I decided to look for a 3rd party control. I've looked for over a week now and can't find anything but ASP.Net stuff when I need a Windows Form control. I've seen dual listbox populators in countless Windows applications, and have seen them run very fast, so I figured this would be extremely popular. Here's how it should work:
1
3039
by: Spock | last post by:
Hi. I have a form with a listbox and a few label fields all bound to a dataset. When i navigate the listbox the labels change accordingly. so far everything works good. I made a button to delete a record. I delete the row from the datatable and update the database with the adapter and that all works good. The record is removed from the listbox. Here is my problem.
10
8565
by: ken | last post by:
Hi, Say I have a list box. I also created a control on a form bound to that list box. When I click different rows in the listbox the control changes the ID of the row depending on what I click. One thing I'm doing is setting the .selected(i) property of the list box to true. On the screen I see that a different row gets hillighted, but the bound control on the form is showing the wrong value? So changing what is selected with code did...
1
4028
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which are not bound, I select from the bottom set and add to the top set which works fine, but now i decide to remove an item from the top set. when i tried to use a remove item code it worked fine, it did delete the item form the list but it added...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8099
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.