I have a combobox in one of my forms that gets populated by an OCR process (so that part works, but want to give a full context of the issue).
Sometimes, the city doesn't get populated (lots of reasons for this), and it's blank. If I put a value into the combobox, I have a "VALID" snippet that checks to see if this is a known city (this is for purpose of establishing suburbs which are used in another area of the application as kind of a "grouping" of cities so on a map, for example, Vienna Virginia, and Washington DC will show up as the same high level point on the map. So that's what this is used for, but here is my problem.
If the field is blank, and I put a value in it, (let's say Montego Bay), which isn't found in the table, I want it to KEEP the value present in the field. I have this code in the VALID clause:
lcCurValue = This.DisplayValue * IF NOT EMPTY(ThisForm.txtState.Value) OR NOT EMPTY(ThisForm.cboCountry.Value) SELECT CTSITE SEEK UPPER(This.Value)+UPPER(ThisForm.txtState.Value) * IF FOUND() ThisForm.cboCountry.Value = CTSITE.SITECOUNTRY ThisForm.txtRegion.Value = CTSITE.SITEREGIONBOUNDARY ELSE lnLaunchRegion = MESSAGEBOX("Region Not Defined, Do You Want to Define it Now?",52,"Region Not Defined") IF lnLaunchRegion = 6 DO FORM CTSITE.SCX ELSE This.Value = lcCurValue This.DisplayValue = lcCurValue This.Parent.txtState.Value = "" REPLACE TTPARSEBC.CITY WITH This.Value ENDIF ENDIF ENDIF
The problem is, as soon as this snippet finishes, the display value is blank. Even though it gets assigned by keeping it with the lcCurValue. Is there something odd about the VALID event that I'm missing?
I even added the "REPLACE" clause in the temp table because I thought the control source was causing the "" value, but that didn't seem to fix it either.
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS
"Everything should be made as simple as possible, and no simpler."