H
Hannah B
Hi All,
Had a wee dig around on this forum but can't find how to fix this
problem - apologies if I've just missed the explanation! Apologies for
un-technical language/poor description - I'm a complete novice at all
this!
I've got a form with 4 cascading combo boxes on it and each narrows
down the user's choices until they've picked a record. That bit works
successfully. Where I've got the problem is when people use the scroll
wheel on the mouse, I want my combo boxes to reflect the new record
they've scrolled to. I've managed this to an extent (works perfect for
the first three combo boxes) but I can't seem to get the final combo
box (cmbPlot) to reflect the record it's on. Worse still, cmbPlot
remains consistently blank - even when you select a value in it, it
immediately goes blank straight after.
I think this must be something to do with the fact that the cmbPlot is
a 2 column combo box where the others are all single column combo
boxes. cmbPlot is the combo box where I have code to choose the record
(hence the 2 columns which are called SurveyID and Surveyed for info).
I know there's something wrong in my code but I just don't know what
it is! Does anybody know how I can overcome this problem? I've pasted
in the code I've used below and please just let me know if you need
anymore info - my explanations aren't always the best! Thanks so much
for all your help already, this is really bugging me!
Hannah
Private Sub Form_Current()
Me!cmbBeach = RefNo
Me!cmbYear = Year
Me!cmbPeriod = Period
Me!cmbPlot = SurveyID
'cmbBeach.Requery
'cmbYear.Requery
'cmbPeriod.Requery
'cmbPlot.Requery
End Sub
Private Sub cmbBeach_AfterUpdate()
Me.[cmbYear] = Null
Me.[cmbYear].Requery
Me.[cmbPeriod] = Null
Me.[cmbPeriod].Requery
Me.[cmbPlot] = Null
Me.[cmbPlot].Requery
End Sub
Private Sub cmbYear_AfterUpdate()
Me.[cmbPeriod] = Null
Me.[cmbPeriod].Requery
Me.[cmbPlot] = Null
Me.[cmbPlot].Requery
End Sub
Private Sub cmbPeriod_AfterUpdate()
Me.[cmbPlot] = Null
Me.[cmbPlot].Requery
End Sub
Private Sub cmbPlot_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[SurveyID] = " & Str(Me![cmbPlot])
Me.Bookmark = rs.Bookmark
End Sub
Had a wee dig around on this forum but can't find how to fix this
problem - apologies if I've just missed the explanation! Apologies for
un-technical language/poor description - I'm a complete novice at all
this!
I've got a form with 4 cascading combo boxes on it and each narrows
down the user's choices until they've picked a record. That bit works
successfully. Where I've got the problem is when people use the scroll
wheel on the mouse, I want my combo boxes to reflect the new record
they've scrolled to. I've managed this to an extent (works perfect for
the first three combo boxes) but I can't seem to get the final combo
box (cmbPlot) to reflect the record it's on. Worse still, cmbPlot
remains consistently blank - even when you select a value in it, it
immediately goes blank straight after.
I think this must be something to do with the fact that the cmbPlot is
a 2 column combo box where the others are all single column combo
boxes. cmbPlot is the combo box where I have code to choose the record
(hence the 2 columns which are called SurveyID and Surveyed for info).
I know there's something wrong in my code but I just don't know what
it is! Does anybody know how I can overcome this problem? I've pasted
in the code I've used below and please just let me know if you need
anymore info - my explanations aren't always the best! Thanks so much
for all your help already, this is really bugging me!
Hannah
Private Sub Form_Current()
Me!cmbBeach = RefNo
Me!cmbYear = Year
Me!cmbPeriod = Period
Me!cmbPlot = SurveyID
'cmbBeach.Requery
'cmbYear.Requery
'cmbPeriod.Requery
'cmbPlot.Requery
End Sub
Private Sub cmbBeach_AfterUpdate()
Me.[cmbYear] = Null
Me.[cmbYear].Requery
Me.[cmbPeriod] = Null
Me.[cmbPeriod].Requery
Me.[cmbPlot] = Null
Me.[cmbPlot].Requery
End Sub
Private Sub cmbYear_AfterUpdate()
Me.[cmbPeriod] = Null
Me.[cmbPeriod].Requery
Me.[cmbPlot] = Null
Me.[cmbPlot].Requery
End Sub
Private Sub cmbPeriod_AfterUpdate()
Me.[cmbPlot] = Null
Me.[cmbPlot].Requery
End Sub
Private Sub cmbPlot_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[SurveyID] = " & Str(Me![cmbPlot])
Me.Bookmark = rs.Bookmark
End Sub