HELP!

davidlim
Posts: 12
Joined: Tue May 06, 2008 10:26 am
Contact:

THANKS

Post by davidlim »

Thanks James.
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

David,

>(2) for DbChoice, to select a customer, HOW to activate an enter key instead of click on OK button for selection?

We need to see your code for dbchoice().

James
davidlim
Posts: 12
Joined: Tue May 06, 2008 10:26 am
Contact:

Post by davidlim »

Here is the source code for DbChoice()

function DbChoice( cTitle, cSelect )

local oDlg, oBrw

DEFINE DIALOG oDlg RESOURCE "DbChoice" TITLE cTitle

REDEFINE LISTBOX oBrw ;
FIELDS ArCust->Code, ArCust->Name ;
HEADERS "Code", "Name" ;
ID 100 OF oDlg

ACTIVATE DIALOG oDlg CENTERED

return nil

Thanks.
davidlim
Posts: 12
Joined: Tue May 06, 2008 10:26 am
Contact:

WORKS!

Post by davidlim »

Hi DUTCH, it WORKS,
(1) i added in exactly what u told and compile, sorry for not notice the complilation error...

REDEFINE GET oGetCode VAR cCode ID 110 OF oDlg Picture "@!" ;
VALID (if(empty(cCode),.F.,(SelectCode( oGetCode,
cCode ),.T.))

missing one ")" at the end.

Thanks.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

David,

Try this:

Code: Select all

function DbChoice( cTitle, cSelect ) 

local oDlg, oBrw 

DEFINE DIALOG oDlg RESOURCE "DbChoice" TITLE cTitle 

REDEFINE LISTBOX oBrw ; 
FIELDS ArCust->Code, ArCust->Name ; 
HEADERS "Code", "Name" ; 
ID 100 OF oDlg 

oBrw:bKeyDown = { | nKey | If( nKey == VK_RETURN, oDlg:End(),) }

ACTIVATE DIALOG oDlg CENTERED 

return nil 
Now when you press enter, the DbChoice() dialog should close automatically
regards, saludos

Antonio Linares
www.fivetechsoft.com
davidlim
Posts: 12
Joined: Tue May 06, 2008 10:26 am
Contact:

OK

Post by davidlim »

"Now when you press enter, the DbChoice() dialog should close automatically" ... Antonio

Ok, Thanks.
Post Reply