Hi ScubaDiver,
(one of my sons just got his scuba certification...)
Have you assigned a ControlSource for each ListBox?
If you are collecting en EmployeeID, would not information
like this be stored in the Employee table? Since you are
picking from a list of Employee names, I assuming that you
are storing the EmployeeID but just showing names.the
records in this table are already created,,,
Is this a form to modify Employee records?
What is the purpose of this form?
Lets say you have the table something like the following:
*Employees*
EmployeeID, autonumber
Lastname, text
Firstname, text
Middlename, text
Status, text
IsActive, yes/no
HourlyRate, currency
etc
Now lets say you have another table with fee paid information
*FeesPaid*
FeePaidID, autonumber
CustomerID, long integer -- FK to Customers table
EmployeeID, long integer -- FK to Employees table
DatePaid, date
Amount, currency
Now lets say that you want to design a form to enable you to
add records when fees are paid, and total what has been paid
so far. You would create a form using the FeesPaid table as
a RecordSource of the form
On the form:
FeePaidID will be a textbox
ControlSource --> CustomerID
Locked --> Yes
TabStop --> No
CustomerID could be a combobox or listbox
ControlSource --> CustomerID
RowSource -->
SELECT CustomerID, Customer FROM Customers ORDER BY
Customer;
ColumnCount --> 2
ColumnWidths --> 0;2
ListWidth --> 2
EmployeeID could be a combobox or listbox
Name --> EmployeeID
ControlSource --> EmployeeID
RowSource -->
SELECT
EmployeeID,
Lastname & ", ' & Firstname & ' ' & Middlename as Employee,
Status,
IIF(IsActive,'Y','') as Active,
HourlyRate
FROM Employees
ORDER BY Lastname, Firstname, Middlename;
ColumnCount --> 5
ColumnWidths --> 0;1.5; .75; .75; .75
ListWidth --> 3.75
then, once a choice is made from the combo or listbox, you
can use calculated fields to show other columns. Column
indexing starts at 0, the Column 1 contains the employee
name (this is already showing since column 0, the ID field,
is hidden by using width=0 in ListWidths)
make textboxes -->
Name --> Status
ControlSource --> EmployeeID.column(2)
TabStop --> No
Locked --> Yes
Name --> Active
ControlSource --> EmployeeID.column(3)
TabStop --> No
Locked --> Yes
Name --> HourlyRate
ControlSource --> EmployeeID.column(4)
TabStop --> No
Locked --> Yes
then, you would have textboxes to collect additional
information such as
Name --> DatePaid
ControlSource --> DatePaid
Name --> Amount
ControlSource --> Amount
In the form footer, you can put a textbox with this calculation:
ControlSource --> =Sum(Amount)
If you want to FILTER the form for a particular employee,
then only fee paid for that employee will be displayed and
the total in the form footer would reflect the sum of what
is displayed.
I believe that, when Duane asked you, "Is there only one
possible related value per employee for each of the combo
boxes?", he was trying to determine if this information was
already stored somewhere. If not, then how would you know
what to pre-select? If so, then why store it again?
He also asked you about the method you were using for
cascading -- in other words, is code being used to determine
the choices and make a selection? are you using queries?
how are you limiting the choices and the selection to a
particular employee?
Warm Regards,
Crystal
Microsoft Access MVP 2006
remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day