G
Guest
I have one form that I use for two actions, modifying existing information
and adding new records. To add a new record, my current method involves
changing the record source to a temp table and append the new record to the
main table. However, I have discovered the option "acFormAdd" on the
docmd.open, etc., as another method and creating a new recordset, using
addnew, and update. These last two seem more elegant, and in an effort to
improve the database I want to learn how they work, but I am having a
problem, well two problems, one with each option. Using both options I have a
message box asking if the person wants to save their entry. If the answer is
no, how do I keep the data from being entered anyway with the docmd option?
If I close the form the data goes in! With the recordset option, I realize
the update should only execute when the user answers yes to saving, however,
the creating of the recordset is giving me problems. Here is what I have
sofar in the form open section.
If NewItem = True Then
Dim dbsInquiry As DAO.Database
Dim rstInquiry As DAO.Recordset
Set dbsInquiry = CurrentDb
Set rstInquiry = dbsInquiry.openrecordset("qry Raw Data",
dbOpenDynaset)
Me.Recordset = rstInquiry
Else
Me.Recordset = "qry Raw Data"
End If
I just want to know the best way to add a new record in a multi-user
environment and give the user the option not to save the entry. I hope this
question is not too involved but I have had trouble locating a good example.
Thanks in advance for your help.
Sincerely
Michael
and adding new records. To add a new record, my current method involves
changing the record source to a temp table and append the new record to the
main table. However, I have discovered the option "acFormAdd" on the
docmd.open, etc., as another method and creating a new recordset, using
addnew, and update. These last two seem more elegant, and in an effort to
improve the database I want to learn how they work, but I am having a
problem, well two problems, one with each option. Using both options I have a
message box asking if the person wants to save their entry. If the answer is
no, how do I keep the data from being entered anyway with the docmd option?
If I close the form the data goes in! With the recordset option, I realize
the update should only execute when the user answers yes to saving, however,
the creating of the recordset is giving me problems. Here is what I have
sofar in the form open section.
If NewItem = True Then
Dim dbsInquiry As DAO.Database
Dim rstInquiry As DAO.Recordset
Set dbsInquiry = CurrentDb
Set rstInquiry = dbsInquiry.openrecordset("qry Raw Data",
dbOpenDynaset)
Me.Recordset = rstInquiry
Else
Me.Recordset = "qry Raw Data"
End If
I just want to know the best way to add a new record in a multi-user
environment and give the user the option not to save the entry. I hope this
question is not too involved but I have had trouble locating a good example.
Thanks in advance for your help.
Sincerely
Michael