TextBox in a Form

  • Thread starter Thread starter Clare
  • Start date Start date
C

Clare

I have a text box related to a table within a form. And
when I change the data in the textbox I want the data to
change in the table automatically without having to close
the form first. Any suggestions.
 
Clare,
Data is saved to the table whenever you go to the next record, close the
form, or explicitly tell it to save by either clicking on the Record
Selector bar or through code.
If you don't wish to close the form, or go to the next record, or click on
the record selector bar, you can code the Control's After Update event:

DoCmd.RunCommand acCmdSaveRecord.

But then as soon as you go to the next record, it would have saved the data
anyway.

The above RunCommand code is useful however in the code to save the current
record before opening a report based upon that record. Is that what you
wanted to do?

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName",acViewPreview, , "[RecordID] = " & [RecordID]
 
Back
Top