C'mon MVP's help me out here

C

Charles

When a cell is changed on a datasheet it appears the underlying recordset is
not updated until the cursor is move off of the row containing that cell.

I want to programmatically force the recordset to be updated in the cells
lostFocus event even if the cursor does notposition on another row.

How can I do that? It seems so simple but I can't make it happen.

CL
 
D

Debra Farnham

Hi Charles

I am no MVP, but the following code on the lostfocus event of your control
should work:

DoCmd.RunCommand acCmdSaveRecord

providing you have satisfied the requirements of the primary key.

Perhaps an MVP will jump into this thread with another/better solution?

HTH

Debra
 
C

Charles

Yes Debra,

That is exactly what I needed. Thank you
You'll always be an MVP to me, lol

CL
 
D

Dirk Goldgar

Debra Farnham said:
Hi Charles

I am no MVP, but the following code on the lostfocus event of your
control should work:

DoCmd.RunCommand acCmdSaveRecord

providing you have satisfied the requirements of the primary key.

Perhaps an MVP will jump into this thread with another/better
solution?

Debra's answer sounds good to me. Charles, you should know that you
don't have to direct your questions to the MVPs. These newsgroups are
places for peer support, meaning everybody helps everybody. MVPs are
just people who've been recognized by Microsoft for helping a lot of
other people.
 
A

Arvin Meyer

Hi Debra (and Charles)

Many of us like to force a save with the line:

Me.Dirty = False

This forces a save by setting the form's Dirty property to False. It is
faster. I'd check any required fields before running any code to save the
record.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access Downloads
http://www.datastrat.com
http://www.mvps.org/access
 
D

Debra Farnham

Thank you Arvin

I knew that an MVP would drop by with some wise advice :)

Debra
 

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