A better mouse trap?

Really enjoyed walking through your code!! Thanks!
After maintaining vba unbound controls for two years, the current assignment is to maintain some one elses code (or lack of it) with no validation at any level, leaving the records with lots of nulls. While I have been able to justify a few new buttons, the basic orders are to "keep it looking the same".
Well, your code example brought to mind something I had not though about.
And that is the Form Cycle property
My project uses All Records - that may explain some unintended events I have been experiencing from time to time.
EXAMPLE: use the Cycle property to specify what happens when you press the TAB key and the focus is in the last control on a bound form. Read/write Byte.
expression.Cycle
expression Required. An expression that returns one of the objects in the Applies To list. For the benefit of others:
The Cycle property uses the following settings.
SettingVBDescriptionAll Records0(Default) Pressing the TAB key from the last control on a form moves the focus to the first control in the tab order in the next record.Current Record1Pressing the TAB key from the last control on a record moves the focus to the first control in the tab order in the same record.Current Page2Pressing the TAB key from the last control on a page moves the focus back to the first control in the tab order on the page.

Note You can set the Cycle property by using the form's property sheet , a macro , or Visual Basic .
 
Hi, (Sorry my english is bad :D)

I use Access 2007.
I have form and subform, and I try create a save bouton, but my code save only my form and not my subform.
so, I try apply your idea, but i dont find where i can change your code for save my fields of subform with my form
 
Records of SubForms are automatically saved when you move the focus back to the MainForm.
 
Then you will probably want to explore transactions or temporary tables.
 
no, but e.g, i modify all records (Mainform and Subform) then i click in cancel, so records of Mainform are not saved but records of Subform are automatically saved.
 
You could then delete all of the records in the Temp table or revert the Transactions.
 
THx again,
A better mouse trap: is good example :)
Bravo, good work
 
For some reason, each time I download this zip file. I get a popup that says, "you are about to open a read only file", then nothing shows up at all. Any help? Upload pls? Thanks
 
I think, I am unzipping? so maybe I am not? How can I from this download? it is not an immediate option.

i have windows 7
 
Last edited:
After you download you need to RightClick the file and go to Properties and "Unblock" the file. Then RightClick and "Extract" the contents of the zip file.
 
I hope ghudson is still about!!
I'm having a load of problems validating a form and then skipping to the enxt record and this seems like it may be of help but I've got access 2016 and it's refusing to open a previous version
Any chance in someone that has an old version of access saving this as a later version or at least an accdb?
 
I don't know if he is but he last posted in June 2018

I've converted the old MDB file to ACCDB & fixed a layout issue in A2019 but otherwise have made no changes to the code

I've never tried it before but it seems to work OK
Hopefully you can now decide whether it solves your issue

Attached zip file contains the original MDB & ACCDB conversion
 

Attachments

I don't know if he is but he last posted in June 2018

I've converted the old MDB file to ACCDB & fixed a layout issue in A2019 but otherwise have made no changes to the code

I've never tried it before but it seems to work OK
Hopefully you can now decide whether it solves your issue

Attached zip file contains the original MDB & ACCDB conversion

Thanks so much. I've just dug out an old laptop which has an earlier version but I think it's steam driven and it's taken 30 minutes to boot it up and get chrome to open!!
 

Users who are viewing this thread

Back
Top Bottom