Full Version: Command Button Coding
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
Mink
I have two command buttons on my form, and one works the way I want while the other works but not as well as I want.

This is the Deny button, which effectively removes the record from the set:
CODE
Me.ECRReviewed.Value = -1
DoCmd.Save
Me.Requery


This is the Approve button, which does it's job by sending the information to another form to be edited, but does not remove the approved form from the query results.
CODE
DoCmd.OpenForm "frmECN", , , "[ECNID]=" & Me.ECNID
[Forms]![frmECN]![ReleaseDate] = Date
Me.ECRReviewed.Value = -1
Me.Requery


The approve button should remove the approved record from the form, but it doesn't. Any suggestions on how to fix this?
strive4peace
instead of using the query to filter, use the form filter

me.filter = "ECRReviewed = 0" 'AND whatever else you are filtering
me.filterOn = true
Mink
Thank you very much. After changing that part it works just fine!
strive4peace
you're welcome wink.gif happy to help
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.