J
Janet
I had requested assistance earlier. Many apologies and
thanks to Marsh for replying to earlier email. But I
discovered what I really need is:
Background is the same: I have three forms. FormA is a
list of salads with two buttons that open the same form
(FormB). FormB contains the ingredients for the various
salads. FormB has a datasheet subform (FormBsub)
allowing you to add or delete ingredients.
FormA: tblSalad, saladID, saladName
child/master link of saladID=saladID between FormA/B
FormB: saladID, ingredientID
FormBsub: ingredientID, ingredientTypeID in continuous
form format with combo box to select above.
What I'd like to do is be able to click Button A on
FormA and have FormB appear but only have items listed in
FormBsub.comboBox with an ingredientTypeID=2 OR if I
click Button B on FormA, have items listed in
FormBsub.comboBox where ingredientTypeID<>2.
I've Tried setting the button click event to:
DoCmd.OpenForm "frmSubParticipants",
whereCondition:="subEventID = [forms]![frmSubEvents]!
[subEventID]"
Forms!frmSubParticipants!txtISDN = 1
Then on the FormBsub load event:
Private Sub Form_Load()
With Me!cboSite
If Forms!frmSubParticipants!txtISDN = 1 Then
.RowSource = "SELECT dbo_xTblSites.siteID,
dbo_xTblSites.siteName, dbo_xTblSites.siteCoor,
dbo_xTblNetwork.networkMethod, " _
& "dbo_xTblNetwork.networkID FROM
(dbo_xTblSites RIGHT JOIN dbo_tblSiteNetworks ON
dbo_xTblSites.siteID = dbo_tblSiteNetworks.siteID) " _
& "LEFT JOIN dbo_xTblNetwork ON
dbo_tblSiteNetworks.networkMethodID =
dbo_xTblNetwork.networkID" _
& "WHERE
(dbo_tblSiteNetworks.networkMethodID<>2) order by
dbo_xTblSites.siteName"
Else
.RowSource = "SELECT dbo_xTblSites.siteID,
dbo_xTblSites.siteName, dbo_xTblSites.siteCoor,
dbo_xTblNetwork.networkMethod, " _
& "dbo_xTblNetwork.networkID FROM
(dbo_xTblSites LEFT JOIN dbo_tblSiteNetworks ON
dbo_xTblSites.siteID = dbo_tblSiteNetworks.siteID) " _
& "LEFT JOIN dbo_xTblNetwork ON
dbo_tblSiteNetworks.networkMethodID =
dbo_xTblNetwork.networkID WHERE " _
& "(dbo_tblSiteNetworks.networkMethodID=2)"
End If
.RowSourceType = "Table/Query"
.BoundColumn = 1
.ColumnCount = 5
.ColumnWidths = "0in;1.7077in;1.166in;1in;0in"
.ColumnHeads = False
.ListRows = 8
End With
End Sub
And, on the AfterUpdate property of the cbo.Site event
Set Forms!frmSubParticipants!frmSubParticipantsB!
networkMethodID = Forms!frmSubParticipants!
frmSubParticipantsB!cboSite!Column(4)
But, I always get the rowset equivalent=2 no matter which
button I use and I get a "Property let procedure not
defined and property get procedure did not return an
object" after updating the combo box. The txtISDN field
does reflect the correct numeric value.
I'm pluggin' away, guys and gals, but could use some
pointers....
jb
thanks to Marsh for replying to earlier email. But I
discovered what I really need is:
Background is the same: I have three forms. FormA is a
list of salads with two buttons that open the same form
(FormB). FormB contains the ingredients for the various
salads. FormB has a datasheet subform (FormBsub)
allowing you to add or delete ingredients.
FormA: tblSalad, saladID, saladName
child/master link of saladID=saladID between FormA/B
FormB: saladID, ingredientID
FormBsub: ingredientID, ingredientTypeID in continuous
form format with combo box to select above.
What I'd like to do is be able to click Button A on
FormA and have FormB appear but only have items listed in
FormBsub.comboBox with an ingredientTypeID=2 OR if I
click Button B on FormA, have items listed in
FormBsub.comboBox where ingredientTypeID<>2.
I've Tried setting the button click event to:
DoCmd.OpenForm "frmSubParticipants",
whereCondition:="subEventID = [forms]![frmSubEvents]!
[subEventID]"
Forms!frmSubParticipants!txtISDN = 1
Then on the FormBsub load event:
Private Sub Form_Load()
With Me!cboSite
If Forms!frmSubParticipants!txtISDN = 1 Then
.RowSource = "SELECT dbo_xTblSites.siteID,
dbo_xTblSites.siteName, dbo_xTblSites.siteCoor,
dbo_xTblNetwork.networkMethod, " _
& "dbo_xTblNetwork.networkID FROM
(dbo_xTblSites RIGHT JOIN dbo_tblSiteNetworks ON
dbo_xTblSites.siteID = dbo_tblSiteNetworks.siteID) " _
& "LEFT JOIN dbo_xTblNetwork ON
dbo_tblSiteNetworks.networkMethodID =
dbo_xTblNetwork.networkID" _
& "WHERE
(dbo_tblSiteNetworks.networkMethodID<>2) order by
dbo_xTblSites.siteName"
Else
.RowSource = "SELECT dbo_xTblSites.siteID,
dbo_xTblSites.siteName, dbo_xTblSites.siteCoor,
dbo_xTblNetwork.networkMethod, " _
& "dbo_xTblNetwork.networkID FROM
(dbo_xTblSites LEFT JOIN dbo_tblSiteNetworks ON
dbo_xTblSites.siteID = dbo_tblSiteNetworks.siteID) " _
& "LEFT JOIN dbo_xTblNetwork ON
dbo_tblSiteNetworks.networkMethodID =
dbo_xTblNetwork.networkID WHERE " _
& "(dbo_tblSiteNetworks.networkMethodID=2)"
End If
.RowSourceType = "Table/Query"
.BoundColumn = 1
.ColumnCount = 5
.ColumnWidths = "0in;1.7077in;1.166in;1in;0in"
.ColumnHeads = False
.ListRows = 8
End With
End Sub
And, on the AfterUpdate property of the cbo.Site event
Set Forms!frmSubParticipants!frmSubParticipantsB!
networkMethodID = Forms!frmSubParticipants!
frmSubParticipantsB!cboSite!Column(4)
But, I always get the rowset equivalent=2 no matter which
button I use and I get a "Property let procedure not
defined and property get procedure did not return an
object" after updating the combo box. The txtISDN field
does reflect the correct numeric value.
I'm pluggin' away, guys and gals, but could use some
pointers....
jb