Select to view content in your preferred language

variable not reseting after form closes

650
1
12-10-2010 09:36 AM
JayKappy
Frequent Contributor
I have a form that opens when user clicks a feature point.
On the second tab a listbox populates with the related features to the main point.
when the user changes the selection in the list box the form chages the record

this works fine.

I now want to popup a message box with a value in one of the textboxes on the form when the user changes the selection in the listbox.
This also works fine....UNTILL I close the form...I click on another point and the form reopens...and then everytime I change the selection in the listbox the messagebox  that pops up keeps giving me the last one selected before the form was closed the first time.

Its drivign me nuts....this runs "OnSelChange" from the listbox

I tried to set the vaiable to "" at the beginning and end of the sub...nothing changes.
I tried to clear the listbox on "OnValdate" and "form close"

I cant figure this out....Anyone have any thoughts or suggestions?

Dim objRS, objSelLayer, objEFPageOneControls4, objEditForm4, objEFPageOneControls2, objEditForm2
Set objSelLayer = Map.SelectionLayer
Set objRS = objSelLayer.Records

objRS.Bookmark = Map.SelectionBookmark
Set objEditForm4 = application.map.layers("Supports").forms("EDITFORM")
Set objEFPageOneControls4 = objEditForm4.Pages("page2").Controls

Dim varMUTCD_Code
varMUTCD_Code = ""
varMUTCD_Code = objEFPageOneControls4("mutcd_code").Value
msgbox "MUTCD CODE: " & varMUTCD_Code
varMUTCD_Code = ""
Tags (3)
0 Kudos
1 Reply
JayKappy
Frequent Contributor
I fugured it out...my code was right but I moved it to a new sub rotine that was actually setting the textboxes with the values....I grabbed the value then, as it was reset at each click in the listbox...
0 Kudos