Actually you should also be able to get rid of setting m.trt first. Just use IF 
MESSAGEBOX(...)=6

--

rk
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Richard Kaye
Sent: Wednesday, October 01, 2014 6:37 PM
To: [email protected]
Subject: RE: Combo

As long as we're refactoring...

IF NOT INDEXSEEK(wintemp.pcode,.f.,[winpcodes],[index tag/name which is not in 
your snippet])
        trt=MESSAGEBOX(ALLTRIM(mPcode)+' does not exist in the analysis table. 
Do you want to ADD this?',4+32,'Good idea') 
        IF trt=6
                INSERT INTO winpcodes (code) VALUES (mPcode)    
        ENDIF
ENDIF
--

rk
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Tracy 
Pearson
Sent: Wednesday, October 01, 2014 6:31 PM
To: [email protected]
Subject: RE: Combo

Sytze de Boer wrote on 2014-10-01: 
>  I have a combo box
>  Controlsource=wintemp.pcode     (temporary table)
>  Rowsource=winpcodes    (free standing table)
>  Rowsourcetype=2 - alias
>  BoundTo=.t.
>  
>  In the valid event, i have
>  
>  mPcode=wintemp.pcode
> 
>     SELECT winpcodes
>     SEEK mpcodes
>     IF !FOUND()
>        trt=MESSAGEBOX(ALLTRIM(mPcode)+' does not exist in the analysis
>        table. Do you want to ADD this?',4+32,'Good idea') IF trt=6
>           APPEND BLANK
>           REPLACE code WITH mPcode
>        ENDIF
>     endif
>  sele wintemp
>  
>  My problem is
>  If mPcode is not found in the winpcodes table, it places a BLANK item 
> in  the winpcodes file
>  
>  It seems not to matter if BoundTo is True or False
>  
>  Any ideas anyone?
>

Sytze,

Why not use an Insert command instead of the Append/Replace?
Since the table is attached to a control, the row may or may not be moving to 
the appending record.

Tracy Pearson
PowerChurch Software


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/DF1EEF11E586A64FB54A97F22A8BD04423C5CC97E3@ACKBWDDQH1.artfact.local
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to