|
-
October 16th, 2001, 07:47 AM
#1
Sub Forms in Access
Hello, I have a problem with Access that I hope someone can help with.
I have a main form entitled "Main", which contains a sub form entitled "DataSheet", this is a datasheet representation of a table in the database. Within the main form, there is a combo box and when the user selects an item from here I need to update the sub form so that it queries the data on this value. Is there any easy way to do it?
Thanks
Andrew
-
October 16th, 2001, 12:08 PM
#2
Re: Sub Forms in Access
This can be done and is very common. It does involve a bit of vb code to make it work.
Subform: The recordset used must reference the combobox of the main form (datasheet field = forms!main.combo1).
Main form: The combo box "should" have a default value for the sub form to work off of, but not required. In the click event of the combo box, requery the subform (that's the vb code portion).
Hope this helps.
TB_Guy_2000
-
October 16th, 2001, 02:26 PM
#3
Re: Sub Forms in Access
Hello,
Thanks very much for your help - I actually found a different way to do it, but similar to yours.
In the event ComboBox_AfterUpdate I call a function within the subform which passes a parameter containing the data item I wish to filter on. As, in my main form I need to add and delete items this method can be done using several functions.
Thanks for your help though, thought I would post a different solution incase anyone was interested!
Andrew
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|