S
SK
Greetings,
I want to be able to display the values in a field
(defined as combo-box) based on the values entered in a
previous field. Both the fields are on the Sub-Form.
The problem I am facing is that the combo-box value list
does not seem to refresh(somehow it seems to memorize the
value entered in the first record).
Bascically, I want to be able to provide a lookup value
(combo-box) for the employee code field(3rd field on the
Sub-Form) based on the Title(designation) chosen in the
current record(Title/Designation field is the 2nd field
on the Sub-Form and is after the Linked field).
Sub-Form Layout:
Region Title EmployeeCode ....
The following query is defined as the Row-source for the
EmployeeCode field in the Sub-Form.
SELECT tblEmployees.EmployeeCode, Trim([FirstName]) & " "
& Trim([LastName]) AS Expr1
FROM tblEmployees
WHERE (((tblEmployees.Title)=[Forms]![frmRegions]!
[frmRegionDefaults].[Form]![Title]));
In the first record, if I choose a particular value for
the Title(let's say "02"), the lookup value list(in the
EmployeeCode field) seems to be OK(i.e. it brings up all
the employee records that have a title code of "02").
However for all subsequent records, the lookup value is
the same irrespective of the title code in the that
record. Somehow, either the query does not seem to run
for every record or the contents are not being refreshed.
Using the Msgbox function, I have noticed that the value
of [Forms]![frmRegions]![frmRegionDefaults].[Form]!
[Title] DOES change based on the title code in the
current record.
Am I missing any step or there is a better way of
achieving this.
Thanks in advance,
SK
I want to be able to display the values in a field
(defined as combo-box) based on the values entered in a
previous field. Both the fields are on the Sub-Form.
The problem I am facing is that the combo-box value list
does not seem to refresh(somehow it seems to memorize the
value entered in the first record).
Bascically, I want to be able to provide a lookup value
(combo-box) for the employee code field(3rd field on the
Sub-Form) based on the Title(designation) chosen in the
current record(Title/Designation field is the 2nd field
on the Sub-Form and is after the Linked field).
Sub-Form Layout:
Region Title EmployeeCode ....
The following query is defined as the Row-source for the
EmployeeCode field in the Sub-Form.
SELECT tblEmployees.EmployeeCode, Trim([FirstName]) & " "
& Trim([LastName]) AS Expr1
FROM tblEmployees
WHERE (((tblEmployees.Title)=[Forms]![frmRegions]!
[frmRegionDefaults].[Form]![Title]));
In the first record, if I choose a particular value for
the Title(let's say "02"), the lookup value list(in the
EmployeeCode field) seems to be OK(i.e. it brings up all
the employee records that have a title code of "02").
However for all subsequent records, the lookup value is
the same irrespective of the title code in the that
record. Somehow, either the query does not seem to run
for every record or the contents are not being refreshed.
Using the Msgbox function, I have noticed that the value
of [Forms]![frmRegions]![frmRegionDefaults].[Form]!
[Title] DOES change based on the title code in the
current record.
Am I missing any step or there is a better way of
achieving this.
Thanks in advance,
SK