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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My code won't end -- have to hit escape to move to next record

Status
Not open for further replies.

input1000

Technical User
Sep 8, 2009
17
0
0
CA
Currently I have a textbox setup that after a user updates the box, it checks to see if what they typed exists in a tag list. If True, Tagcheck=true, If false Tagcheck=false.

There is then conditional formatting on the box, when true background is green, if false background is red.

Problem #1:
After I do this and get to the bottom of the record and click to open a new record, it will not let me move to the next record until I hit escape.
Problem #2:
When I go to the next record, the box should be white if empty, or Green is True or Red is false, but the box stays the same color as the last time that I ran the code.

Private Sub txtTagLine_AfterUpdate()

If Not IsNull(DLookup("[Cable_No]", "[UnionTagLists]", "[Cable_No] = '" & Me.txtTagLine & "'")) Then
TagCheck = True
Me.txtDwg = DLookup("[From_Dwg]", "[UnionTagLists]", "[Cable_No] = '" & Me.txtTagLine & "'")
Me.[Discrepancy Detail] = Me.txtTagLine
Else
TagCheck = False

End If



End Sub
 

Have you tried putting the same code in the OnCurrent event?


Randy
 
I would actual just start removing or commenting out a line at a time to see where the performance gets whacked. Once you know what is causing the issue, you will be closer to finding a fix.

Duane
Hook'D on Access
MS Access MVP
 
I tried using oncurrent but it did not do what I needed.

I tried the issue but its only when the whole code runs,
It will not let me move to a new or the next record after this code runs and makes the box change color.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top