How do you save a record in ms access using vb

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dvdsackey
    New Member
    • Feb 2010
    • 1

    How do you save a record in ms access using vb

    I want to save the record on a form before creating a report.
    Shit+Enter could do it but I would like to add a "save record" to a click event of a button that creates the report.

    Can anyone please help.
    David
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi. If you are working in an MS Access form you can check the form's Dirty property, which is set to True if the current record has been modified but not saved. A simple way to save the record is simply to reset the property to false -which saves the current record as a result. The VBA for this is simply

    Code:
    If Me.Dirty then
        Me.Dirty = False
    End If
    -Stewart

    Comment

    • Kinwang2009
      New Member
      • Feb 2010
      • 22

      #3
      Hi David,
      Do you mean that you are using VB as front end and MSAccess Database as back end? If so you can save records on VB form by connecting to Database and using Update method.

      Good Luck

      Comment

      Working...