Finding Last Record

  • Thread starter Afrosheen via AccessMonster.com
  • Start date
A

Afrosheen via AccessMonster.com

I'm using the normal find/replace box to lookup a person by last name. The
person is in the data table and query. I've seen it in both places. when I
try and find it through my form it will not find it. When look for it in the
table, it finds it all the time.

Any suggestions I can try?

Here's the code behind the command button:

20 Screen.PreviousControl.SetFocus
30 Me![Lname].SetFocus
40 DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Thanks for helping out and reading my post.
 
A

Andrew Tapp

From the acMenuVer70 constant i assume you are using Access 95.

The oldest version of access i currently use is 2000, and i can't remember
if the syntax changes between '95 and 2000. Anyway this is what i would do
in 2000;

Set the focus to the control that you want to find the text in.
Me!Lname.SetFocus

Then find the text in that control.
DoCmd.FindRecord findwhat[, match][, matchcase][, search][,
searchasformatted][, onlycurrentfield][, findfirst]

e.g. DoCmd.FindRecord "Text", acEntire

Hope this helps.
 
A

Afrosheen via AccessMonster.com

Thanks Andrew for your reply. I'm sorry, I probably don't understand. I cut
and pasted your code in and tried it. It came up with Compile error Expected
end of statement.

Besides not finding the record on the find button, it will not display the
record in the form. Weird. It's in the table and the query.

The version of Access is 2003 and it's on a command button. So, the command
was built by Access.

Thanks for your help.


Andrew said:
From the acMenuVer70 constant i assume you are using Access 95.

The oldest version of access i currently use is 2000, and i can't remember
if the syntax changes between '95 and 2000. Anyway this is what i would do
in 2000;

Set the focus to the control that you want to find the text in.
Me!Lname.SetFocus

Then find the text in that control.
DoCmd.FindRecord findwhat[, match][, matchcase][, search][,
searchasformatted][, onlycurrentfield][, findfirst]

e.g. DoCmd.FindRecord "Text", acEntire

Hope this helps.
I'm using the normal find/replace box to lookup a person by last name. The
person is in the data table and query. I've seen it in both places. when I
[quoted text clipped - 10 lines]
Thanks for helping out and reading my post.
 

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