commit changes

S

Sanjin Vidlanovic

I have two forms Form1 and Form2. Form1 has record source Table1, Form2 has
record source Table2.
Table2 has foreign key (key of Table1).

Form1 has a button that opens Form2.

I'd like to commit changes made on Form1 before opening Form2. I can do it
by closing and reopening of Form1, but I'm sure there's better way (requery
just saves data and leaves me with a blank form)


Thx, Sanjin
 
C

Chris Large

Hi

Before the code that opens Form2, add the code:-

if me.dirty then me.dirty = false


hth

Chris
 
C

Cheryl Fischer

You could possibly use the following line of code just before the command to
open Form2

DoCmd.RunCommand acCmdSaveRecord
 
S

Sanjin Vidlanovic

Chris Large said:
Hi

Before the code that opens Form2, add the code:-

if me.dirty then me.dirty = false


hth

Chris

WOW! Great, that is what I needed. Thx
 
S

Sanjin Vidlanovic

Cheryl Fischer said:
You could possibly use the following line of code just before the command to
open Form2

DoCmd.RunCommand acCmdSaveRecord


This works too. Thx!
 

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