Bind a new Subform on the MainForm

abhiutd

Registered User.
Local time
Today, 03:56
Joined
Jul 28, 2008
Messages
48
Hi, I already had a form with one subform but now i want to show some other info on the main form so i am trying to add a subform( dont know if there is a control to just listing items). I assigned my query to the Data of the subform but when i am trying to add a Child Link it says "Can't build a link btween unbound forms". What am i doing wrong. Filter on this subform should be done on the basis of an ID on the main form. I have that ID in the subform table as FK already.
Any help or suggestion of doing it in any other way is greatly appreciated. I dont know if i can do this using some control rather than using subform.

Thank You.
 
Hello guys,
I was able to bind my subform but i am still wondering if i can rather use some control that would allow me to show a numbered list of items?
eg.

List of Books:
1. Book 1
2. Book2
3, Book3

Thank You.
 
Would Listbox do the job?

What exactly do you want to do with the list?
 
Thank you for your response. Well its just meant to be displayed, nothing much.
 
Then a unbound listbox will just do nicely. Just drag'n'drop a listbox, set its rowsource to the query that will list all books.
 
Yeah but how will i link the ID to the ID of the form so i see the books only relevant to the record on the main form?
 
use criteria in query builder to set ID. If you right-click on the criteria row, you can select "Build...". Navigate to Forms -> Loaded Forms -> Name of your form -> <Field List> -> ID of your book. Click OK, then it will now filter only books associated with that ID you're looking at.

Then on the OnCurrent event of your form, add this code:

Code:
Me.MyListBoxName.Requery

HTH.
 
Okay, Pls excuse me as i am fairly new to Access. The query i am binding to is a plain select like select BookTitle from Books. Books has a FK as ID which relates to the PK ID in Client table. When you say "If you right-click on the criteria row" i'm not very sure what you mean or how i do that. Can you please help. Sorry again but i am really a novice, pls bear with me.

Thank You.
 
When you go into design view for query there's a grid on bottom where you select columns names from different tables. The fourth row is "Criteria". You would right click on Criteria for the column with that FK ID so it looks up that form's current ID.

Did that help?
 
Awesome! Thank You for your help Banana :) Access programming making lot of sense now. I have downgraded myself from ASP.NET 2.0 to Access. Can you believe that :(
 

Users who are viewing this thread

Back
Top Bottom