Hello Everyone,
We have a problem with a specific LISTBOX. For some reason, the listbox is displaying incorrect details, specifically when no key is found. The associated DBF has an index related to the specific key. What would cause this problem?
I have checked the DBF for corruption and I have deleted the index and rebuilt
//
//
// Source
DEFINE DIALOG oDlgEvent RESOURCE "EVENT" TITLE cEtitle
REDEFINE COMBOBOX aGet[01] VAR cEvent ID 101 ITEMS aEvent OF oDlgEvent
REDEFINE GET aGet[02] VAR dDate ID 102 OF oDlgEvent PICTURE "@D"
REDEFINE GET aGet[03] VAR cTime ID 103 OF oDlgEvent PICTURE "99:99"
REDEFINE GET aGet[04] VAR cBy ID 104 OF oDlgEvent PICTURE "@!"
REDEFINE GET aGet[05] VAR cNotes ID 105 MEMO OF oDlgEvent
REDEFINE CHECKBOX aGet[06] VAR lCts ID 106 OF oDlgEvent
REDEFINE CHECKBOX aGet[07] VAR lEmship ID 107 OF oDlgEvent ;
VALID( _GetRef( aGet ), .T. )
REDEFINE GET aGet[08] VAR cShipem ID 108 OF oDlgEvent WHEN lEmship
REDEFINE CHECKBOX aGet[09] VAR lEmcons ID 109 OF oDlgEvent ;
VALID( _GetRef( aGet ), .T. )
REDEFINE GET aGet[10] VAR cConsem ID 110 OF oDlgEvent WHEN lEmcons
REDEFINE CHECKBOX aGet[11] VAR lEmothr ID 111 OF oDlgEvent ;
VALID( _GetRef( aGet ), .T. )
REDEFINE GET aGet[12] VAR cOthrem ID 112 OF oDlgEvent WHEN lEmothr
// Event...
SELECT event
SET ORDER TO TAG S3
GO TOP
SEEK cFileNumber
REDEFINE LISTBOX oLbx2 FIELDS _EventDescription( event->event, aEvent ) , ;
ALLTRIM( event->notes ) , ;
DTOC(event->date) , ;
event->time , ;
event->by , ;
event->file ;
ID 6000 ;
HEADERS "Event", "Location/Notes", "Date", "Time", "By", "." ;
FIELDSIZES 350 , 350 , 85 , 50 , 200 , 99 ;
SELECT file FOR cFileNumber ;
ON DBLCLICK _EventDet() ;
OF oDlgEvent
REDEFINE BUTTON ID 202 OF oDlgEvent ACTION ( _EventUpd( @nRecId, @aEvent, @cEvent, @dDate, @cTime, @cBy, @cNotes, @lCts, @lEmShip, @cShipEm, @lEmCons, @cConsEm, @lEmothr, @cOthrEm ), _GetRef( aGet ), Sysrefresh() )
REDEFINE BUTTON ID 203 OF oDlgEvent ACTION _EventDel( oLbx2, cFileNumber ) WHEN lAdmin
REDEFINE BUTTON ID 200 OF oDlgEvent ACTION ( lUpd := .T., oDlgEvent:End() ) WHEN ( ! LEFT( cEvent, 1 ) $ "-" ) .AND. ( ! EMPTY( dDate ) ) .AND. ( ! EMPTY( LEFT(cTime,2) ) )
REDEFINE BUTTON ID 201 OF oDlgEvent ACTION ( lUpd := .F., oDlgEvent:End() )
ACTIVATE DIALOG oDlgEvent CENTERED VALID _EventOk( @lUpd, cEvent, dDate, cTime, cBy )
//
//
// Source RC compiled with Pelles C
EVENT DIALOG DISCARDABLE 49, 49, 600, 350
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION
CAPTION "Event Manager"
FONT 10, "tahoma"
{
CONTROL "Event.........................", -1, "Static", WS_GROUP, 5, 7, 75, 8
CONTROL "", 101, "ComboBox", WS_BORDER|CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP, 85, 5, 345, 300
CONTROL "Event Date.................", -1, "Static", WS_GROUP, 5, 21, 75, 8
CONTROL "", 102, "Edit", ES_AUTOHSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 20, 45, 12
CONTROL "Event Time................", -1, "Static", WS_GROUP, 5, 36, 75, 8
CONTROL "", 103, "Edit", ES_AUTOHSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 35, 45, 12
CONTROL "Event Name...............", -1, "Static", WS_GROUP, 5, 51, 75, 8
CONTROL "", 104, "Edit", ES_AUTOHSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 50, 150, 12
CONTROL "Event Notes................", -1, "Static", WS_GROUP, 5, 66, 75, 8
CONTROL "", 105, "Edit", ES_MULTILINE|ES_AUTOVSCROLL|ES_WANTRETURN|ES_UPPERCASE|WS_BORDER|WS_TABSTOP, 85, 65, 345, 30
CONTROL "Display on Cargo Tracking System (CTS)", 106, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 100, 149, 12
CONTROL "E-Mail Shipper", 107, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 115, 60, 12
CONTROL "", 108, "Edit", WS_BORDER|WS_TABSTOP, 85, 115, 345, 12
CONTROL "E-Mail Consignee", 109, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 130, 72, 12
CONTROL "", 110, "Edit", WS_BORDER|WS_TABSTOP, 85, 130, 345, 12
CONTROL "E-Mail Other Party", 111, "Button", BS_AUTOCHECKBOX|WS_TABSTOP, 5, 145, 77, 12
CONTROL "", 112, "Edit", WS_BORDER|WS_TABSTOP, 85, 145, 345, 12
CONTROL "OK", 200, "Button", WS_TABSTOP, 540, 5, 50, 14
CONTROL "Cancel", 201, "Button", WS_TABSTOP, 540, 24, 50, 14
CONTROL "Double Click Event below to view details", -1, "Static", SS_CENTER|WS_GROUP, 216, 160, 167, 8
CONTROL "", 6000, "TWBrowse", WS_TABSTOP|0x00b00000, 5, 170, 590, 150
CONTROL "Edit Event", 202, "Button", WS_TABSTOP, 191, 327, 100, 14
CONTROL "Remove Event", 203, "Button", WS_TABSTOP, 309, 327, 100, 14
CONTROL "Military Time", -1, "Static", SS_CENTER|WS_GROUP, 135, 36, 47, 8
}