how can i make a data control read several tables of a database (this tables are conected with an ID number).
I want the data control to control some text boxes which will use the information of one table, and a datagrid that will use another table.
Printable View
how can i make a data control read several tables of a database (this tables are conected with an ID number).
I want the data control to control some text boxes which will use the information of one table, and a datagrid that will use another table.
You will have to set the recordset property of the datacontrol to the result of an SQL call.
Dim rcsTemp as recordset
Dim SQLStatement as string
SQLStatement = "Select [Fields] from [Table1] INNER JOIN [Table n] ....."
Set rcsTemp = YourDB.OpenRecordset(SQLStatement)
Set myDatControl = rcsTemp.
Your datacontrol will now contain the recordset based on your SQL call on the relevant tables.
Hope this is of assistance.
I don“t know what should i put in "YourDB"??
Hi, this would be about "YourDB" :
dim YourDB as DAO.Database
set YourDB = opendatabase("Here goes the complete path to your database whichever directory it is in")
All the best...vijay