Re: Populating a form from combo box
- From: Carlos1815 <Carlos1815@xxxxxxxxx>
- Date: Thu, 12 Jun 2008 08:07:30 -0700 (PDT)
On Jun 11, 5:52 pm, Klatuu <Kla...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Why do you have a separate table for each topic?
What you really should have is one table with a field that identifies the
topic.
Then all you would need to do is include a reference to the combo box in the
subform's record source.
Make the record source a query on the table and in the Topic Field, use the
criteria
Forms!MyFormName!MyComboBoxName
What you are doing will only make things harder for you.
--
Dave Hargis, Microsoft Access MVP
"Carlos1815" wrote:
I have a form with a combo box that has a row source of a table
containing topic titles. On this form I have a sub form where a user
can add data to a topic. What I'd like to have is to have the user
choose a topic from the combo box, and have the subform populated with
the data from the topic (a separate table for each topic) chosen in
the cbo box. This way, I can avoid having 18 separate subforms, just
one form with a subform that allows the user to enter data into one of
18 chosen topics (tables).
Is there a way to do this? I've looked, and most of the advice given
was populating a form from a combo box using data from the same table
used by the cbo box, not a different table.
Thanks!
Carlos- Hide quoted text -
- Show quoted text -
I understand, this is my first project and I'm really starting to see
where my mistakes are and how they affect the project. However, I'm
kind of at a point of no return with this project, so I just need to
make what I have work as best as I can. The reason why I have a
separate table for each topic is that the designers who will use this
project want the ability to shuffle the pages around which requires a
resort of the pageID's since I didn't want to actually move the data
around; this would be exceedingly more difficult with multiple topics
having multiple pages that need to be sorted on one table. At least,
that sounds well beyond my pay grade... ;)
For my original question, I used this code:
Private Sub Topic_Name_AfterUpdate()
If Not IsNull(Me.Topic_Name) Then
Select Case Me.Topic_Name
Case 1
Me.subfrmTopic1.Form.RecordSource = "Topic1"
Case 2
Me.subfrmTopic1.Form.RecordSource = "Topic2"
Case 3 ... (etc. for each topic)
End Select
End If
End Sub
and this works just as I described I wanted to work.
Carlos
.
- Follow-Ups:
- Re: Populating a form from combo box
- From: Klatuu
- Re: Populating a form from combo box
- References:
- Populating a form from combo box
- From: Carlos1815
- Populating a form from combo box
- Prev by Date: Re: After update disabling controls
- Next by Date: Re: Default value on form using conditional expression?
- Previous by thread: Populating a form from combo box
- Next by thread: Re: Populating a form from combo box
- Index(es):
Relevant Pages
|