COMBOBOX with oDBF

COMBOBOX with oDBF

Postby Ollie » Wed Jan 03, 2007 8:07 pm

I want to store 'L', 'A' or 'O' in a (1 character) database field called MAIL_CAT (Mail category = Local, African, Overseas)

But I want to use a Combobox so the user can only make a valid choice, but I only want to store the first letter ie. L, A, or O in the database.

REDEFINE COMBOBOX oDBF:MAIL_CAT ITEMS {"Local", "African", "Overseas" } ID 4012 OF oDLG

... doesn't do it.

Is there a way the screen can show 'Overseas' when it sees 'O' in the database field? How?
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby James Bott » Wed Jan 03, 2007 8:22 pm

Use a DBCombo. See \samples\testdbc1.prg for an example.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Ollie » Wed Jan 03, 2007 8:41 pm

Thanks.

I have this code:

REDEFINE DBCOMBO oDBF:MAIL_CAT ID 4012 ;
items {"L","A","O"} ;
list {"Local","African","Overseas"} ;
of oFld:aDialogs[ 1 ] UPDATE

But the compiler gives a "parse error at 'DBCOMBO' what am I doing wrong?
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am

Postby James Bott » Wed Jan 03, 2007 8:58 pm

#include "dbcombo.ch"
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Ollie » Wed Jan 03, 2007 9:11 pm

That did it. EXCELLENT !!! Thanks.
Many thanks
Ollie.

Using:
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)
Borland C++ 5.5.1
FWH 9.04 (2009 Apr)
Ollie
 
Posts: 233
Joined: Sat Dec 30, 2006 6:10 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 62 guests