Form not displaying correct record

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

Guest

I really need some help.
When you open the form it asks for an acct number and then runs an update
query. then all the info is displayed into the form. The user may also make
changes via the form to records in the table.
My problem is it wont always display the acct info that was just inserted
into the table. It will grab the first record and display it.
I added an auto number to the table and then tried to use the find last
record to display but it wont work consistantly.
I am trying to use this code on the form load but it isnt working correctly.
docmd.FindRecord("Max [ecmform].[Lat]",acEntire,,acSearchAll,,acAll,,)
Any ideas? I am in a real jam here.
Thanks
 
It would help if you post the code for your Form_Load procedure, and the
code that inserts the new record into your table, and also any other code
that is involved with positioning of the current record.

I can tell you for a start that your FindRecord code below will not work.
It is trying to find the value "Max [ecmform].[Lat]" (this actual string) in
the field for the current control that has the focus.

It looks like you ate trying to move to the record that has the highest
value in the [Lat] field. In this case, you could try the following code:

With Me.RecordsetClone
.FindFirst "[Lat]=" & DMax("[Lat]", "[Name of your table]")
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
 
Back
Top