Save Record without navigation or closing

ViRi

Registered User.
Local time
Today, 10:49
Joined
Jan 31, 2006
Messages
44
Hi

I have a form with a button and a text box

The control source for the text box is a Number field called FileNo in a Table called File. THe default value of the text box is 0.

When the button is clicked a value is calculated using the last value under FileNo in the Table.

The problem is that I have to either navigate the records or close the form in order to save the new value onto the Table.

I need to be able to save a new value to the Table as soon as it is generated without having to close or navigate. So that I get some new value everytime I click the button without closing the Form.
(when the button is clicked 1 will be added to the last value under FileNo on Table File)

ViRi
 
In your coding for the button's OnClick event - add this line after the code has updated the text box with its new value:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
 
If you are using 2000 or later ( I think that it's only 97 you can't use this)


Code:
If Me.Dirty Then
DoCmd.RunCommand acCmdSaveRecord
End If

instead of:

Code:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
 

Users who are viewing this thread

Back
Top Bottom