any sample with browse two database db1, db2 with txbrowse
db1 - main database
nr_:=db1->nr
db2->(dbseek(nr,.f.))
best regards
kajot
kajot
any sample with browse two database db1, db2 with txbrowse
db1 - main database
nr_:=db1->nr
db2->(dbseek(nr,.f.))
sorry two database
nr_:=db1->nr
db2->(dbseek(nr_,.f.))
Hello Kajot,
In one database I have the customer.
Each customer owns a ID-no, because there can be customers
with the same name.
The 2. database includes the software, belongs to the customer.
To show the software of the customer in Database 2,
i use a RELATION.
Does this sample explain, what you want to do ?
Regards
Uwe ![]()
I want to browse Invoices (db1) and their items (db2)
#include 'fivewin.ch'
#include 'xbrowse.ch'
REQUEST DBFCDX
function Main()
OpenData()
BrowseData()
return nil
static function BrowseData
local oDlg, oBrw1, oBrw2, oFont
DEFINE FONT oFont NAME 'TAHOMA' SIZE 0,-12
DEFINE DIALOG oDlg SIZE 640,460 PIXEL FONT oFont
@ 10, 10 XBROWSE oBrw1 ;
COLUMNS 'Code','Name' ;
SIZE 300,100 PIXEL ;
OF oDlg ;
ALIAS 'STATES' ;
CELL LINES
@ 120, 10 XBROWSE oBrw2 ;
COLUMNS 'State', 'City', 'First', 'Salary' ;
SIZE 300,100 PIXEL ;
OF oDlg ;
ALIAS 'CUST' ;
CELL LINES
oBrw1:bChange := { || oBrw2:Refresh() }
oBrw1:CreateFromCode()
oBrw2:CreateFromCode()
ACTIVATE DIALOG oDlg CENTERED ON INIT oBrw1:SetFocus()
RELEASE FONT oFont
return nil
//---------------------------------------------------------
static function OpenData
FIELD CODE
CheckIndex() // If sure abt indexes comment out this function call
USE CUSTOMER NEW SHARED ALIAS CUST VIA 'DBFCDX'
SET ORDER TO TAG STATE
GO TOP
USE STATES NEW SHARED VIA 'DBFCDX'
SET RELATION TO CODE INTO CUST SCOPED
GO TOP
return nil
static function CheckIndex()
FIELD STATE
USE CUSTOMER NEW EXCLUSIVE VIA 'DBFCDX'
If !( OrdNumber( 'STATE' ) > 0 .and. Upper( OrdKey( 'STATE' ) ) == 'STATE' )
INDEX ON STATE TAG STATE
endif
CUSTOMER->( DbCloseArea() )
return nilsuper, thanks