Data in Mainform and Subform

B

Beeyen

Good Day,

I have a mainform and subform with tabs. Whenever I enter information into
a field in the mainform and then go to a tab in the subform I receive a ‘Save
Record†message (the coding is located below). When I select ‘No’ the input
on the mainform disappears and the field in the subform I am trying to select
to include information with the record becomes active. If I select yes to
save the record is not complete with the right choices and opens a new
record. The message just recently started appearing.

Has anyone experienced this and if, so can you share your resolve.

Thanks

Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Workload Tracker Data has changed."
strMsg = strMsg & "@Would you like to save the changes?"
strMsg = strMsg & "@Click Yes to Save or No to Discard changes and exit
out."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
'do nothing
Else
DoCmd.RunCommand acCmdUndo

'Created for WHI Benefits use by Michael Banks
End If
End Sub
 
G

GBA

just off the cuff;

it asks you if you want to 'Save Record' - and when you select NO then it
does not...

which is the way it is written by Michael Banks

what is the question??
 
B

Beeyen

Good Day GBA,

Thanks for the response. The problem is it tries to save without being able
to add the information from the Tabs in the Subforms and then creates a new
form.
 
B

Beeyen

Good Day GBA,

Thanks for the quick response, but sorry for the inconvenience; the record
is doing what it is suppose to do as you mentioned. I completed the
mainform, accepted yes to save, entered information in the subform and it all
saved as one record.

Thanks
 

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