ID not showing in two-column combo box of cascading lists

G

Guest

In a form, I have a combo box for "segment". Once the segment is selected by
the user, they then click on "fgroup" and the fgroup combo box list shows
them only the fgroups pertaining to the selected segment. My problem is that
the "fgroup" list box is supposed to have 2 columns: (1) Fgroup_ID and (2)
Fgroup, and only the Fgroup is showing up after the segment is selected. I'm
sure I need something related to the "Fgroup_ID" in my code, but I don't know
what. Here's what I have so far:

'After the user selects a Segment, it limits the list of Fgroups to only
those applicable
'to the selected Segment.

Private Sub cboSEGMENT_AfterUpdate()
On Error Resume Next
cboFGROUP.RowSource = "Select tPRODUCT_FGROUP.FGROUP " & _
"FROM tPRODUCT_FGROUP " & _
"WHERE tPRODUCT_FGROUP.SEGMENT = '" & cboSEGMENT.Value & "' " & _
"ORDER BY tPRODUCT_FGROUP.FGROUP_ID;"

End Sub
 
G

Guest

cheri624 said:
In a form, I have a combo box for "segment". Once the segment is selected by
the user, they then click on "fgroup" and the fgroup combo box list shows
them only the fgroups pertaining to the selected segment. My problem is that
the "fgroup" list box is supposed to have 2 columns: (1) Fgroup_ID and (2)
Fgroup, and only the Fgroup is showing up after the segment is selected. I'm
sure I need something related to the "Fgroup_ID" in my code, but I don't know
what. Here's what I have so far:

'After the user selects a Segment, it limits the list of Fgroups to only
those applicable
'to the selected Segment.

Private Sub cboSEGMENT_AfterUpdate()
On Error Resume Next
cboFGROUP.RowSource = "Select tPRODUCT_FGROUP.FGROUP " & _
"FROM tPRODUCT_FGROUP " & _
"WHERE tPRODUCT_FGROUP.SEGMENT = '" & cboSEGMENT.Value & "' " & _
"ORDER BY tPRODUCT_FGROUP.FGROUP_ID;"

End Sub

P.S.....I forgot to mention that I DO NOT need to store the Fgroup_ID
anywhere. It is strictly on the form to aid the data entry person in making
their selection. Only the Fgroup will be stored.
 
G

Guest

If a column is not showing up in a combo box, it is probably not a code
related issue. Check to see what the column width for each column is in the
combo box properties. If you used the wizard to construct the combo box, it
may have set the unbound column width to 0. This will cause the column not
to display.
 
G

Guest

I didn't use wizards. I constructed the combox box and my column widths are
1";3.5". If I don't make a "segment" selection, and then click the "fgroup"
drop down, everything shows up fine. That's why I thought there is something
missing in the AfterUpdate for the "segment". Can I send you a printscreen
of what it looks like, and you will see what I mean? Let me know your
thoughts.
 
G

Guest

I don't know that it would help. Have you tried requerying the combox box as
the last line of the After Update?

Please take no offense, but I am reluctant to post my work E-mail address.
I did once, and it caused a problem with E-mail viruses coming in to everyone
in my domain.
 
G

Guest

'Allows the user to requery the list of Fgroup names as a new Segment is
selected.

Private Sub FGROUP_AfterUpdate()
FGROUP.Requery
End SubHere

Private Sub SEGMENT_AfterUpdate()
FGROUP.Requery
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top