Kamis, 04 Juni 2020

Re: [MSAccessProfessionals] Updating a list box after new record entry

Crystal,
I do not see any "pencil" that you indicate.  I tried Ctrl-S and that did not do it either.   I put the Me.listbox_list32.requery in the form's AfterUpdate event but that did not get it either.

Please see attached image of my form.



"How can I save the record without closing that form?"

manually, you can click on the record selector box (where the pencil is, indicating there are unsaved changes. If it doesn't show or you want the keyboard shortcut, it is Ctrl-S

To automatically save a record when a particular value is changed, on that control AfterUpdate:

Me.Dirty = False

this is a somewhat obscure way to save a record because it isn't very intuitive, but good to memorize ;)

no need to test if the record is dirty first because the code runs on the AfterUpdate event of a control, so it obviously changed ;)

However, that won't requery a combo box. To do that, you can put this code on the Form AfterUpdate event:

Me.combo_controlname.requery

WHERE

combo_controlname is the NAME property of the combo box (or listbox)

 

kind regards,
crystal

_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#115551) | Reply To Group | Reply To Sender | Mute This Topic | New Topic

Your Subscription | Contact Group Owner | Unsubscribe [sugeng.panjalu.access@blogger.com]

_._,_._,_

Tidak ada komentar:

Posting Komentar