Prompt to save when using a tab control

F

forest8

Hi there

In my database, I have a form which consists of 5 tabs.

When a user moves from tab to tab, is it possible to set a prompt that
prompts the user to save their work?

I have users who think that this is a necessary feature of my database.

Thank you in advance for your help.
 
J

John W. Vinson

Hi there

In my database, I have a form which consists of 5 tabs.

When a user moves from tab to tab, is it possible to set a prompt that
prompts the user to save their work?

I have users who think that this is a necessary feature of my database.

Thank you in advance for your help.

ummm...

This is somewhat confusing.

Data is not stored in forms or in tabs. The data will automatically be saved
to the table (completely independently of any tabs) when you move to a
different record or close the form; if there are subforms on the tab pages,
data will be saved the instant you leave the subform, or enter a new one.
Moving from one tab page to another will not otherwise cause data to be lost
(or saved either). You certainly don't NEED to interrupt the user, or make
them respond to a prompt, in order to save data. This may just be a user
training issue!

But that said, you can certainly put code in the Change event of the Tab
control, such as

Private Sub tabcontrolname_Change()
Dim iAns as Integer
iAns = MsgBox("Do you want to save your work?", vbYesNo)
If iAns = vbYes Then
If Me.Dirty Then Me.Dirty = False ' save the record to disk
Else
<do something appropriate for not saving the data>
End If
End Sub
 

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