Field Display

  • Thread starter Thread starter Wayne
  • Start date Start date
W

Wayne

Hi,

I have little problem that might be hard to explain, so
please bear with me.
I have a listbox on a form that displays workcodes using a
query on the workcodes table.
The workcodes table has a true/false field that lets me set
whether a workcode is active or not.
The query looks up the true/false field and so the listbox
only displays the entries where it is true.
This all works fine except for one little problem.
When I look up an existing record on the form, If the
workcode for that record is one that has since been made
inactive/false, then the workcode field displays blank.
What I want to happen is to be able to remove workcodes
from the listbox that are no longer required without them
disapearing from existing records.

Any ideas??
 
The likeliset explanation is that there is some code on the
edit form that blanks out the name when the active/inactive
indicator is set to False.

Hope This Helps
Gerald Stanley MCSD
 
Yes, there is a where statement in the query that makes it
display only the workcodes where the true/false field is
true. And I just realised its actually a combo box i'm
talking about not a listbox, sorry.
What i want to know is if there is any way to make it so
that the false work codes will be hidden in the pull part
of the combo box but will appear in the display portion of
the combo box if they have previously been selected.
 
Can you reply to this thread with the RowSource SQL and the
BoundColumn of the comboBox.

Gerald Stanley MCSD
 
The rowsource SQL is:
SELECT DISTINCTROW [Work Codes].WorkCodeID, [Work
Codes].SortOrder, [Work Codes].WorkCode
FROM [Work Codes]
WHERE ((([Work Codes].Active)=True))
ORDER BY [Work Codes].SortOrder, [Work Codes].WorkCode;

The bound colomn is WorkCodeID, and WorkCode is the field
that is displayed in the combo box.
The Control Source is WorkCodeID in a table called Time
Card Hours.

Thanks
 
Wayne

Give the following a try
1- In the Design View set the RowSource SQL to what is
below without the WHERE clause
2- In the comboBox's GotFocus eventHandler, set the
RowSource SQL to as below
3- In the comboBox's LostFocus eventHandler, set the
RowSource SQL to include the WHERE clause.

The effect should be that the comboBox textbox will always
be populated as youscroll through the records. However,
when you click on the comboBox, the dropdown list will be
restricted to only the active workcodes.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
The rowsource SQL is:
SELECT DISTINCTROW [Work Codes].WorkCodeID, [Work
Codes].SortOrder, [Work Codes].WorkCode
FROM [Work Codes]
WHERE ((([Work Codes].Active)=True))
ORDER BY [Work Codes].SortOrder, [Work Codes].WorkCode;

The bound colomn is WorkCodeID, and WorkCode is the field
that is displayed in the combo box.
The Control Source is WorkCodeID in a table called Time
Card Hours.

Thanks
-----Original Message-----
Can you reply to this thread with the RowSource SQL and the
BoundColumn of the comboBox.

Gerald Stanley MCSD
.
.
 
Thanks for your help. It Works!
-----Original Message-----
Wayne

Give the following a try
1- In the Design View set the RowSource SQL to what is
below without the WHERE clause
2- In the comboBox's GotFocus eventHandler, set the
RowSource SQL to as below
3- In the comboBox's LostFocus eventHandler, set the
RowSource SQL to include the WHERE clause.

The effect should be that the comboBox textbox will always
be populated as youscroll through the records. However,
when you click on the comboBox, the dropdown list will be
restricted to only the active workcodes.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
The rowsource SQL is:
SELECT DISTINCTROW [Work Codes].WorkCodeID, [Work
Codes].SortOrder, [Work Codes].WorkCode
FROM [Work Codes]
WHERE ((([Work Codes].Active)=True))
ORDER BY [Work Codes].SortOrder, [Work Codes].WorkCode;

The bound colomn is WorkCodeID, and WorkCode is the field
that is displayed in the combo box.
The Control Source is WorkCodeID in a table called Time
Card Hours.

Thanks
-----Original Message-----
Can you reply to this thread with the RowSource SQL and the
BoundColumn of the comboBox.

Gerald Stanley MCSD
-----Original Message-----
Yes, there is a where statement in the query that makes it
display only the workcodes where the true/false field is
true. And I just realised its actually a combo box i'm
talking about not a listbox, sorry.
What i want to know is if there is any way to make it so
that the false work codes will be hidden in the pull part
of the combo box but will appear in the display portion of
the combo box if they have previously been selected.
-----Original Message-----
The likeliset explanation is that there is some code on the
edit form that blanks out the name when the active/inactive
indicator is set to False.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
Hi,

I have little problem that might be hard to explain, so
please bear with me.
I have a listbox on a form that displays workcodes using a
query on the workcodes table.
The workcodes table has a true/false field that lets me set
whether a workcode is active or not.
The query looks up the true/false field and so the listbox
only displays the entries where it is true.
This all works fine except for one little problem.
When I look up an existing record on the form, If the
workcode for that record is one that has since been made
inactive/false, then the workcode field displays blank.
What I want to happen is to be able to remove workcodes
from the listbox that are no longer required without them
disapearing from existing records.

Any ideas??
.

.

.

.
.
.
 
Back
Top