1

Topic: the text in the Inscription

All greetings.
On the form there are 3 Inscriptions. It is necessary to import to them values from the table (Packet)
In the table always only single line and three filled weeding. But this field is created by means of the master of substitutions.
How to import values to inscriptions?
Found in not those such (more low). But how to calculate request and to import it in the field?

Dim dbsNorthwind As DAO.Database
Dim rstProducts As DAO.Recordset
Dim strSQL As String
Set dbsNorthwind = CurrentDb
strSQL = "SELECT Address. Address FROM Packet INNER JOIN Address ON Packet. AdrID = Address. FilID;"
Set rstProducts = dbsNorthwind. OpenRecordset (strSQL)
Me._.Caption =?

2

Re: the text in the Inscription

Devil_FoX;
If table Packet is filled, it is possible
Set dbsNorthwind = CurrentDb
strSQL = "SELECT F1, F2, F3 FROM Packet"
Set rstProducts = dbsNorthwind. OpenRecordset (strSQL)
Me._.Caption =rstProducts (0)
Me._.Caption =rstProducts (1)
Me._.Caption =rstProducts (2)

3

Re: the text in the Inscription

For this example and provided that _ - an element of type "Inscription":

Me! [_].Caption = rstProducts! [Address]

But for  three values your request should be under construction on 4 tables (Packet and tables-sources of the substitutions connected (it is better LEFT JOIN) with Packet on appropriate fields.

4

Re: the text in the Inscription

Uralec;
And if through  turn out Id records of the table of a source instead of value:
Me._.Caption=DLookup ("The Necessary field", "the table a source", "Id =" and rstProducts (0))
Not so beautifully, but if there are problems with advanced queries that it is possible so to solve.

5

Re: the text in the Inscription

Uralec, Krivtsov Anatoly;
Thanks you. I altered also all works a little.

Set dbsNorthwind = CurrentDb
strSQL = "SELECT Address. Address, Supplier. Name, Packet. Annex FROM (Packet INNER JOIN Supplier ON Packet. PostID = Supplier. ID) INNER JOIN Address ON Packet. AdrID = Address. FilID;"
Set rstProducts = dbsNorthwind. OpenRecordset (strSQL)
Me._.Caption = rstProducts (0)
Me._.Caption = rstProducts (1)