Data does not show when scrolling through records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have a form which already has data in the underlying table. The first
record shows in it's entirety, but if I scroll to the second and third
records, some of the fields are blank, even though I keep populating them.
The fields which go blank are dependent on the first field which is not, but
this field only has an AfterUpdate event; surely just scrolling through
should not trigger this?
 
Is this a single view form or a continuous form or datasheet? If the
controls on a form are dependent upon another control, they are not bound to
the underlying fiels in the table. The AfterUpdate event is not triggered by
scrolling, only by updating the control (or form).

You must bind your control to an underlying field for it to display data
from that field.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Thanks for the speedy reply...

It is a single view form. All the controls are bound to the underlying
table; the controls that go blank are using a lookup based on the value in
the first control on the form to limit the choices available to the user. I
used an AfterUpdate event in the first control as I found that changing this
control didn't refresh the choices available in the subsequent controls.
 
Hi Arvin

I don't have much code as I'm no expert, but I copied this syntax from an
example in the Access help:

All the fields are combo boxes, e.g. the user selects Hospital and then this
limits the choice of Session_name etc. This code should not run except if
Hospital is changed. Hospital is my unique identifier, and is a foreign key
in each of my session/room/staff id tables.

Private Sub Hospital_AfterUpdate()
Session_name = Null
Session_name.Requery
Session_name = Me.Session_name.ItemData(0)
Room_ID = Null
Room_ID.Requery
Room_ID = Me.Room_ID.ItemData(0)
Consultant_ID = Null
Consultant_ID.Requery
Consultant_ID = Me.Consultant_ID.ItemData(0)
Endoscopist_ID = Null
Endoscopist_ID.Requery
Endoscopist_ID = Me.Endoscopist_ID.ItemData(0)
End Sub

Bev
 
Hi Arvin

I have just deleted the bound fields and re-added them to the form, and
recreated the lookups, based again on Hospital. If I let the combo box show
the bound column in the field rather than the text value linked to the bound
column, then when I scroll through the records, the number remains. It's
only when I hide the bound column that I get the problem of values
disappearing. Have you come across this before?

Many thanks for your input BTW.

Bev
 
Back
Top