By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,107 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,107 IT Pros & Developers. It's quick & easy.

Help with CASE button problem

P: n/a
Could somebody please help me out with this easy one? I have a five button
toggle set up. Case 1-4 work fine, so I have ommitted the code from this
post. I need help with Case 5.

Case five should:

a) Make ClutchIDDropdown visible (works fine)
b) ClutchIDdropdown should display the clutchID values from the AddAnimal
table (this works fine)
c) Based on the ClutchID chosen, cboMoveTo should display any animalID and
Nick-name with a matching ClutchID.
This only works the first time. CboMoveTo does not refresh/requery properly
everytime if ClutchIDDropDown changes.

Private Sub optionframe_AfterUpdate()
Select Case Me.OptionFrame
Case 1 'All animals

Case 2 'Internal to collection

Case 3 'External to collection

Case 4 'Sold

Case 5 'Search By Clutch ID
ClutchIDDropDown.Visible = True
Me.ClutchIDDropDown.RowSource = "SELECT DISTINCTROW
AddAnimal.ClutchID " & _
"FROM AddAnimal ORDER BY
Addanimal.ClutchID;"

......................CASE 5 WORKS FINE TO THIS
POINT.....................

Me.cboMoveTo.RowSource = "SELECT DISTINCTROW
addanimal.AnimalTableID,
AddAnimal.Nickname " & _
"FROM AddAnimal WHERE
AddAnimal.ClutchID=ClutchIDdropDown.value;"

.....................Code above works fine once, but cboMoveTo does not
refresh/requery properly if ClutchIDDropDown changes values....

End Select
Me.cboMoveTo.Requery
Me.ClutchIDDropDown.Requery
End Sub

Thanks for any help

Tim G.
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
> This only works the first time. CboMoveTo does not refresh/requery properly
everytime if ClutchIDDropDown changes.


You would need to requery CboMoveTo whenever ClutchIDDropDown is updated, so in
the "AfterUpdate" event procedure of ClutchIDDropDown, you would need to add
this code:

Me.CboMoveTo.Requery

--
Bruce M. Thompson, Microsoft Access MVP
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access)
NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<
Nov 12 '05 #2

P: n/a
That worked!!

Thanks Bruce

"Bruce M. Thompson" <bthmpson@big_NOSPAM_foot.com> wrote in message
news:vm************@corp.supernews.com...
This only works the first time. CboMoveTo does not refresh/requery properly
everytime if ClutchIDDropDown changes.
You would need to requery CboMoveTo whenever ClutchIDDropDown is updated,

so in the "AfterUpdate" event procedure of ClutchIDDropDown, you would need to add this code:

Me.CboMoveTo.Requery

--
Bruce M. Thompson, Microsoft Access MVP
bt******@mvps.org (See the Access FAQ at http://www.mvps.org/access) NO Email Please. Keep all communications

within the newsgroups so that all might benefit.<<

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.