Unbound controls

B

Boz

I've created an Attendance Tracking database. There are 3 tables

tbl_Associates
Clock Number
Last Name
First Name

tblAttendance
Attendance Code
Hours Used
Date of Infraction

The form for entering the information uses a query:
Clock Number (Associate Table)
Combo Box for Last Name ***code below***
Combo Box for First Name ***code below***
Attendance Code (Attendance Table)
Hours (Attendance Table)
Date (Attendance Table)

***Code for combo box***

Private Sub Clock___AfterUpdate()
Me.LastName = Me.Clock__.Column(1)
Me.FirstName = Me.Clock__.Column(2)
End Sub


The form I've designed is in a continuous form format to allow the clerk to
enter all data for the previous day. The clock # uses a lookup for the
associate clock number, then fills in the last name and first name.
Everything works fine until I go to the next record to enter a different
associate. Although I change the clock number, the last name and first name
changes to the new name on all records.

What simple, stupid thing am I doing wrong this time?

THanks,

Linda



Was this post helpful to you?


Reply | Print post TopTop





luan 5/27/2008 8:04 PM PST

I've created an Attendance Tracking database. There are 3 tables

tbl_Associates
Clock Number
Last Name
First Name

tblAttendance
Attendance Code
Hours Used
Date of Infraction

The form for entering the information uses a query:
Clock Number (Associate Table)
Combo Box for Last Name ***code below***
Combo Box for First Name ***code below***
Attendance Code (Attendance Table)
Hours (Attendance Table)
Date (Attendance Table)

***Code for combo box***

Private Sub Clock___AfterUpdate()
Me.LastName = Me.Clock__.Column(1)
Me.FirstName = Me.Clock__.Column(2)
End Sub

The form I've designed is in a continuous form format to allow the clerk to
enter all data for the previous day. The clock # uses a lookup for the
associate clock number, then fills in the last name and first name.
Everything works fine until I go to the next record to enter a different
associate. Although I change the clock number, the last name and first name
changes to the new name on all records.

What simple, stupid thing am I doing wrong this time?

THanks,

Linda

Hi, Linda !
I guess LastName and FirstName control in your form are unbound
control, Right ?
If so, this is the trouble come from.
HTH


Thanks for the reply, but I really need to know what to do to fix it.
 
J

Jeanette Cunningham

Boz,
The problem is that on a continuous Form, there is really only *one* combo
box - displayed many times. If you change its properties (its RowSource in
this case), all rows reflect that change.

One work around is to put a Textbox onto the form, carefully superimposed
over the text area of the combo box (don't cover the dropdown tool though).
Set its Control Source to either a DLookUp expression looking up the current
record's value from the lookup table, or (if practical) base the Form on a
query joined to the lookup table and simply make it a bound textbox.

Set the textbox's Enabled = No, Locked = Yes, Tab Stop = No so the user
can't do anything with it; it's for display only. You may need to move it in
front of the combo box (with Move To Front on the Format menu).

When the user selects the dropdown, the combo box data will come in front
and allow (filtered) selection; when it's not selected, the user will see
the textbox.


Jeanette Cunningham -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top