By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,668 Members | 1,503 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,668 IT Pros & Developers. It's quick & easy.

Find: record found, incorrect data shown

P: n/a
HJ
Hi all,

Consider an Access 2002 run-time application on Windows XP. The controls on
a form are locked until the user clicks an Edit button. The form is based on
a query and all controls are bound.

On this form the user can use a Find button to call the standard Find
dialog. Then the user enters search criteria and the wanted record can be
found.

This works fine, except for some occasions when the correct record number
has been found, but not all data in the controls correspond with this record
number. Only when the user clicks the Edit button to make modifications the
corresponding data are shown.

It looks like the display is not being refreshed correctly. This happens
infrequently and so far only on a single computer (and not on five other
computers with the same application). What may be the cause of this?

HJ
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
More information please:

What version of Access and what service pack? (Help | About)

How is the record being found? Bookmark of form?

Roughly how many records in the form's recordset at the time when it fails?

Is this a continuous form with some text boxes in the form footer section?

Are you explicitly saving before attempting to move?

The controls that don't match - anything consistent about them, e.g. are
they bound to expressions that are not updated in time?

Is there anything in other events (e.g. Form_Current) that could be
relevent?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"HJ" <hj******@hotmail.com> wrote in message
news:3f***********************@dreader7.news.xs4al l.nl...

Consider an Access 2002 run-time application on Windows XP. The controls on a form are locked until the user clicks an Edit button. The form is based on a query and all controls are bound.

On this form the user can use a Find button to call the standard Find
dialog. Then the user enters search criteria and the wanted record can be
found.

This works fine, except for some occasions when the correct record number
has been found, but not all data in the controls correspond with this record number. Only when the user clicks the Edit button to make modifications the corresponding data are shown.

It looks like the display is not being refreshed correctly. This happens
infrequently and so far only on a single computer (and not on five other
computers with the same application). What may be the cause of this?

Nov 12 '05 #2

P: n/a
HJ
OK. See answers below. Thanks for your help.

HJ

"Allen Browne" <ab***************@bigpond.net.au> wrote in message
news:ri*******************@news-server.bigpond.net.au...
More information please:

What version of Access and what service pack? (Help | About)
Access 2002, no service pack applied.
How is the record being found? Bookmark of form? Standard Access Find dialog box. I do not know how Access does it's search.

Roughly how many records in the form's recordset at the time when it fails? About 15.000
Is this a continuous form with some text boxes in the form footer section? Single form. Text boxes only in Detail section.
Are you explicitly saving before attempting to move? No.
The controls that don't match - anything consistent about them, e.g. are
they bound to expressions that are not updated in time? No. Controls are directly bound to table fields (through the query of
course).
Is there anything in other events (e.g. Form_Current) that could be
relevent? Yes.
1. The current record number and the total number of records are printed in
a label caption.
2. Controls are being locked when the record is not a new record. For the
finding procedure this will always be the case.

Private Sub Form_Current()

'Fill the recordnumber label
Dim rs As DAO.Recordset
If Me.NewRecord Then
Me.lblRecordNumber.Caption = "New item"
Else
Set rs = Me.RecordsetClone
rs.MoveLast
rs.MoveFirst
With Me.RecordsetClone
.Bookmark = Me.Bookmark
Me!lblRecordNumber.Caption = "Item " & _
.AbsolutePosition + 1 _
& " of " & .RecordCount
End With
End If

If Me.NewRecord Then
Call UnlockFields
Else
Call LockFields
End If

Me.lblLocked.Visible = False
Me.puAddressee.SetFocus

End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"HJ" <hj******@hotmail.com> wrote in message
news:3f***********************@dreader7.news.xs4al l.nl...

Consider an Access 2002 run-time application on Windows XP. The controls on
a form are locked until the user clicks an Edit button. The form is

based on
a query and all controls are bound.

On this form the user can use a Find button to call the standard Find
dialog. Then the user enters search criteria and the wanted record can

be found.

This works fine, except for some occasions when the correct record number has been found, but not all data in the controls correspond with this

record
number. Only when the user clicks the Edit button to make modifications

the
corresponding data are shown.

It looks like the display is not being refreshed correctly. This happens
infrequently and so far only on a single computer (and not on five other
computers with the same application). What may be the cause of this?


Nov 12 '05 #3

P: n/a
While I'm not aware of a specific issue with A2002, the service packs are
always worth while when things are not working well.

Explicit save before any move/filter can save some weird behavior in Access.
Before calling the find dialog, you might consider adding:
If Me.Dirty Then
Me.Dirty = False
End If

Would it be possible to test this with the Form_Current disabled? That would
establish whether it is playing any part in the problem. Anything that
happens between the start of the problem (issuing the Find) and the end
(record displayed) should be considered as possibly related.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"HJ" <hj******@hotmail.com> wrote in message
news:3f***********************@dreader8.news.xs4al l.nl...
OK. See answers below. Thanks for your help.

HJ

"Allen Browne" <ab***************@bigpond.net.au> wrote in message
news:ri*******************@news-server.bigpond.net.au...
More information please:

What version of Access and what service pack? (Help | About)
> Access 2002, no service pack applied.
How is the record being found? Bookmark of form?
> Standard Access Find dialog box. I do not know how Access does it's search.

Roughly how many records in the form's recordset at the time when it

fails?> About 15.000


Is this a continuous form with some text boxes in the form footer section?
> Single form. Text boxes only in Detail section.


Are you explicitly saving before attempting to move?
> No.


The controls that don't match - anything consistent about them, e.g. are
they bound to expressions that are not updated in time?
> No. Controls are directly bound to table fields (through the query of course).

Is there anything in other events (e.g. Form_Current) that could be
relevent?
> Yes. 1. The current record number and the total number of records are printed

in a label caption.
2. Controls are being locked when the record is not a new record. For the
finding procedure this will always be the case.

Private Sub Form_Current()

'Fill the recordnumber label
Dim rs As DAO.Recordset
If Me.NewRecord Then
Me.lblRecordNumber.Caption = "New item"
Else
Set rs = Me.RecordsetClone
rs.MoveLast
rs.MoveFirst
With Me.RecordsetClone
.Bookmark = Me.Bookmark
Me!lblRecordNumber.Caption = "Item " & _
.AbsolutePosition + 1 _
& " of " & .RecordCount
End With
End If

If Me.NewRecord Then
Call UnlockFields
Else
Call LockFields
End If

Me.lblLocked.Visible = False
Me.puAddressee.SetFocus

End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"HJ" <hj******@hotmail.com> wrote in message
news:3f***********************@dreader7.news.xs4al l.nl...

Consider an Access 2002 run-time application on Windows XP. The controls on
a form are locked until the user clicks an Edit button. The form is based
on
a query and all controls are bound.

On this form the user can use a Find button to call the standard Find
dialog. Then the user enters search criteria and the wanted record can

be found.

This works fine, except for some occasions when the correct record number has been found, but not all data in the controls correspond with this

record
number. Only when the user clicks the Edit button to make

modifications the
corresponding data are shown.

It looks like the display is not being refreshed correctly. This

happens infrequently and so far only on a single computer (and not on five other computers with the same application). What may be the cause of this?



Nov 12 '05 #4

P: n/a
HJ
Thx for your help. I will try that next week at the office.

HJ

"Allen Browne" <ab***************@bigpond.net.au> wrote in message
news:e8*******************@news-server.bigpond.net.au...
While I'm not aware of a specific issue with A2002, the service packs are
always worth while when things are not working well.

Explicit save before any move/filter can save some weird behavior in Access. Before calling the find dialog, you might consider adding:
If Me.Dirty Then
Me.Dirty = False
End If

Would it be possible to test this with the Form_Current disabled? That would establish whether it is playing any part in the problem. Anything that
happens between the start of the problem (issuing the Find) and the end
(record displayed) should be considered as possibly related.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"HJ" <hj******@hotmail.com> wrote in message
news:3f***********************@dreader8.news.xs4al l.nl...
OK. See answers below. Thanks for your help.

HJ

"Allen Browne" <ab***************@bigpond.net.au> wrote in message
news:ri*******************@news-server.bigpond.net.au...
More information please:

What version of Access and what service pack? (Help | About)
>>> Access 2002, no service pack applied.

How is the record being found? Bookmark of form?
>>> Standard Access Find dialog box. I do not know how Access does it's

search.

Roughly how many records in the form's recordset at the time when it

fails?
>>> About 15.000

Is this a continuous form with some text boxes in the form footer section?>>> Single form. Text boxes only in Detail section.

Are you explicitly saving before attempting to move?
>>> No.

The controls that don't match - anything consistent about them, e.g. are they bound to expressions that are not updated in time?
>>> No. Controls are directly bound to table fields (through the query of
course).

Is there anything in other events (e.g. Form_Current) that could be
relevent?
>>> Yes.

1. The current record number and the total number of records are printed

in
a label caption.
2. Controls are being locked when the record is not a new record. For the
finding procedure this will always be the case.

Private Sub Form_Current()

'Fill the recordnumber label
Dim rs As DAO.Recordset
If Me.NewRecord Then
Me.lblRecordNumber.Caption = "New item"
Else
Set rs = Me.RecordsetClone
rs.MoveLast
rs.MoveFirst
With Me.RecordsetClone
.Bookmark = Me.Bookmark
Me!lblRecordNumber.Caption = "Item " & _
.AbsolutePosition + 1 _
& " of " & .RecordCount
End With
End If

If Me.NewRecord Then
Call UnlockFields
Else
Call LockFields
End If

Me.lblLocked.Visible = False
Me.puAddressee.SetFocus

End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"HJ" <hj******@hotmail.com> wrote in message
news:3f***********************@dreader7.news.xs4al l.nl...
>
> Consider an Access 2002 run-time application on Windows XP. The controls on
> a form are locked until the user clicks an Edit button. The form is

based
on
> a query and all controls are bound.
>
> On this form the user can use a Find button to call the standard
Find > dialog. Then the user enters search criteria and the wanted record can be
> found.
>
> This works fine, except for some occasions when the correct record

number
> has been found, but not all data in the controls correspond with

this record
> number. Only when the user clicks the Edit button to make

modifications the
> corresponding data are shown.
>
> It looks like the display is not being refreshed correctly. This happens > infrequently and so far only on a single computer (and not on five other > computers with the same application). What may be the cause of this?



Nov 12 '05 #5

P: n/a
HJ
Thx. I can add this just as well, although the controls are all in the
Detail section. All controls are text boxes. I will see this week what I
happens.

HJ

"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:6b********************************@4ax.com...
You were not specific about which controls do and do not show the correct
data, but there is a bug in both Access 2K and 2K2 in which, sometimes the
form header/footer do not synchronize with the current row in the detail.
The fix that has worked for me is to requery one of the controls in the
header or footer in the form's Current event handler. I just automatically add this code to any form with a header or footer now in order to avoid the problem.

On Sat, 30 Aug 2003 11:25:38 +0200, "HJ" <hj******@hotmail.com> wrote:
Hi all,

Consider an Access 2002 run-time application on Windows XP. The controls ona form are locked until the user clicks an Edit button. The form is based ona query and all controls are bound.

On this form the user can use a Find button to call the standard Find
dialog. Then the user enters search criteria and the wanted record can be
found.

This works fine, except for some occasions when the correct record number
has been found, but not all data in the controls correspond with this recordnumber. Only when the user clicks the Edit button to make modifications thecorresponding data are shown.

It looks like the display is not being refreshed correctly. This happens
infrequently and so far only on a single computer (and not on five other
computers with the same application). What may be the cause of this?

HJ

- Steve Jorgensen

----
I would have written you a shorter program,
but I didn't have the time.

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.