Save Record and Close Window

G

Guest

I have a form that launches a subform upon clicking a button. On the
subform, one value is entered and a button clicked to save and close the
subform. For some reason it's not saving my data. Here's the code used.

Private Sub Command124_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
End Sub
 
D

doodle

What is your data source for the subform? what are the fields for that
data source? The record should save automatically without the code.

-doodle
 
J

Joseph Meehan

zachnjoe said:
I have a form that launches a subform upon clicking a button. On the
subform, one value is entered and a button clicked to save and close
the subform. For some reason it's not saving my data. Here's the
code used.

Private Sub Command124_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
End Sub

It should save IF there tables are updateable. Relationships sometimes
will prevent updating do to logical restraints.
 
G

Guest

When the form is launched, I use the function Dmax to increment the last
number saved plus one. The form launches fine and the number increments but
does not save to the table. The table has no relationships with any other
table or forms of my database.
 

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