Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Refresh Problem

Status
Not open for further replies.

ambs24

Technical User
Jan 28, 2002
6
US
I have two text boxes (txtUnitType and txtPieces). The visible property of txtPieces is set to No, but I have VBA code to change it to Yes based on the value of txtUnitType. My problem occurs when the value of txtUnitType is updated to one that requires txtPieces to become visible – it doesn’t happen until I’ve exited the form and reentered. I’ve tried including me.refresh, me.requery, and me.repaint in the AfterUpdate and OnChange events of txtUnitType, but nothing worked. Just for fun, I even added a command button to refresh the form and it still didn’t make txtPieces visible. The only thing that works is to close the form and reopen it. Any other suggestions are greatly appreciated!
 
You shouldn't have to refresh the form, put this on the AfterUpdate event on the txtUnitType field:

Me.txtPieces.Visible = txtUnitType = YourCriteriaHere
Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
Thanks for the quick response. I already have a Select Case that establishes the criteria in the AfterUpdate event of txtUnitType. I believe that should accomplish the same thing that you suggested, but it still isn't working.
 
Try-'
within txtUnitType After Update' put-

If me.txtUnitType = "required criteria" Then

me.txtPieces.Visible = True
me.txtPieces.Requery

Else
 
Great suggestion, but it still didn't work.
 
In the After update put

if txtUnitType = "your criteria" then
txtPieces.visible = true
else txtPieces.visible = false
end if

I tried it on form here and it works on Access 97
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top