Combobox in continuous form record (1 Viewer)

exaccess

Registered User.
Local time
Today, 06:17
Joined
Apr 21, 2013
Messages
287
The theater is as follows:
A continuous form with fields Operation bounded integer, LibelBx unbounded combobox string with two columns as Sorter (Int), Phrase(str).
A table TargetTbl with field Operation(Int). A table TextArrayTbl with fields Phrase(str), Sorter(Int).
Relationship between TargetTbl and TextArrayTbl is one to many joined on Operation = Sorter.
I am trying to display the form. RecordSource = TargetTbl. LibelBx.RowSource = TextArrayTblQy.

The idea is to display every record from TargetTbl with Operation equal to Sorter from TextArrayTbl. The LibelBx combobox should display the Sorter and Phrase.

The queries are:
Code:
TextArrayTblQy = "SELECT TargetTbl.Booking, TargetTbl.Operation, TargetTbl.CodeBilan, TargetTbl.Debit, TargetTbl.Credit, TargetTbl.Total, TextArrayTbl.Sorter, TextArrayTbl.Phrase
FROM TargetTbl INNER JOIN TextArrayTbl ON TargetTbl.[Operation] = TextArrayTbl.[Sorter];"

Code:
TextArrayTblQy = "SELECT TargetTblQuery.Sorter, TargetTblQuery.Phrase
FROM TargetTblQuery, TextArrayTbl, TargetTbl
WHERE (([TargetTblQuery].[Sorter]=[TargetTbl].[Operation]));"

Code:
TargetTblQuery = "SELECT TextArrayTbl.Sorter, TextArrayTbl.Phrase
FROM TargetTbl, TextArrayTbl
WHERE (((TextArrayTbl.Sorter)=[TargetTbl].[Operation]));"

I managed to get the TexArrayTbl displayed in LibelBx combobox, but it displays all the records whereas I want it to display only the ones with Sorter = Operation.
Help please.
 
Last edited:

llkhoutx

Registered User.
Local time
Today, 00:17
Joined
Feb 26, 2001
Messages
4,018
For starters, join TargetTable, operation and TextArraytbl, sorter in a query.
 

exaccess

Registered User.
Local time
Today, 06:17
Joined
Apr 21, 2013
Messages
287
OK. I managed to solve the problem by replacing the queries as follows:

Code:
RecordSource = "TargetTbl"

RowSource = "SELECT TextArrayTbl.Sorter, TextArrayTbl.Phrase
FROM TextArrayTbl LEFT JOIN TargetTbl ON TextArrayTbl.Sorter = TargetTbl.Operation
WHERE (((TextArrayTbl.Sorter)=[Forms].[DisplayTargetFm].[Operation]));"

Attention in RowSource the lines are broken due to the word wrapping of the site editor.
 

Users who are viewing this thread

Top Bottom