cj_borntorun
Thread Starter
- Joined
- Jan 3, 2004
- Messages
- 30
Here's are the facts regarding my Access form:
- Combo Box "Segment" allows user to make a selection
- Combo Box "Fgroup" limits the user choices to only those applicable to the Segment they selected.
- I would like to display (for the user) a 2-column combo box with "Fgroup_ID" in column 1 and "Fgroup" in column 2. Only the "Fgroup" needs to be bound and stored in my underlying table. The "Fgroup_ID" is strictly there for informational purposes to assist the user in making their selection.
PROBLEM: I think the AfterUpdate on the Segment combo box is not recognizing both the Fgroup and Fgroup_ID columns. Can someone review this code and tell me what and where to insert the "Fgroup_ID" column information? I'm a rookie at writing code and appreciate any help I can get. I'm going to (try) to attach 2 printscreens of what the drop down list provides now, and what I would like it to
'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
'Allows the user to requery the list of Fgroup names as a new Segment is selected.
Private Sub FGROUP_AfterUpdate()
FGROUP.Requery
End Sub
Private Sub SEGMENT_AfterUpdate()
FGROUP.Requery
End Sub
- Combo Box "Segment" allows user to make a selection
- Combo Box "Fgroup" limits the user choices to only those applicable to the Segment they selected.
- I would like to display (for the user) a 2-column combo box with "Fgroup_ID" in column 1 and "Fgroup" in column 2. Only the "Fgroup" needs to be bound and stored in my underlying table. The "Fgroup_ID" is strictly there for informational purposes to assist the user in making their selection.
PROBLEM: I think the AfterUpdate on the Segment combo box is not recognizing both the Fgroup and Fgroup_ID columns. Can someone review this code and tell me what and where to insert the "Fgroup_ID" column information? I'm a rookie at writing code and appreciate any help I can get. I'm going to (try) to attach 2 printscreens of what the drop down list provides now, and what I would like it to
'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
'Allows the user to requery the list of Fgroup names as a new Segment is selected.
Private Sub FGROUP_AfterUpdate()
FGROUP.Requery
End Sub
Private Sub SEGMENT_AfterUpdate()
FGROUP.Requery
End Sub
Attachments
-
10.3 KB Views: 13