Saving record

josros60

Well-known Member
Joined
Jun 27, 2010
Messages
732
Office Version
  1. 365
Hi,

I have a button in form for saving record but seems not to work because i click save but doesn't show the record i click next and then back still not save.

here it's the code:

Code:
On Error GoTo Err_Command118_Click

    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Me.Company.SetFocus
Exit_Command118_Click:
    Exit Sub

Err_Command118_Click:
    MsgBox Err.Description
    Resume Exit_Command118_Click
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

SydneyGeek

MrExcel MVP
Joined
Aug 5, 2003
Messages
12,251
How is the form set up? Is it based on a table or query? If it is there should be no need to save the record; it will save when you try to move off the record or close the form.
Unless the control that you are trying to save the value for is unbound... in that case you will need code that writes the value to a table field in the current record.

If the form is NOT based on a table or query, you will need code that writes the values to a new record (or edits an existing record) in a table.

In either case (unbound form or unbound control), the Save command won't help you.

Denis
 

Forum statistics

Threads
1,175,515
Messages
5,897,885
Members
434,686
Latest member
asdf12l3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top