471,059 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,059 software developers and data experts.

Automatically modify date field in Form

4 Nibble
Hi there,
I am trying to set the date that a record was modified automatically when I change a record. I am using Microsoft Access 2013, but I think this was originally an Access 2000 database, if that makes a difference

I followed the instructions here: https://support.microsoft.com/en-us/...8-c246505af66d

Here is the end result:

. I then put that into my form field in the "Before Update" Event as instructed in the above link.

But it is not working.

If I try to manually enter a date in that form field, I get this:

which then displays this:

I looked up Error 2425, which led me to this page (among others): https://bytes.com/topic/access/answe...g-error-2425-a

But I don't understand how to check whether it's Public or in a standard module; much less how to correct the issue.

What puzzles me is that I have used this macro before and it works flawlessly everytime. But the other database is a later version database. Could that be the issue?

Any help is appreciated in correcting this issue. And while I have been working with access for years, in this case, assume that I know nothing (which could very well be true, considering I am pretty much self-taught).

1 Week Ago #1
6 4301
32,341 Expert Mod 16PB
Hi Videot7.

I do very little work with macros directly but do bear in mind if you're working with Macros - as opposed to VBA code - then they are stored as Macros and not in Modules of any type.

In the VBA IDE (Integrated Development Environment for VBA) there is a Project Explorer window that has three main sections under the project itself :

These contain the different types and only the one titled (simply) Modules contains the Standard ones referred to. Module types cannot be changed. If you have a variable declared in one (A) and you need it in somewhere else (B) instead then you have to delete it from A and add it to B.

Public items (Variables or Procedures) are declared as Public (or even Global if they're very old). All Modules are publicly available so this isn't a relevant issue for them. Only if they're Standard or otherwise.

Macros are stored and managed from within the database itself. You can see this in the Shutter Bar as so :

I have too little information to go on in order to be sure but I suspect you have no addressable Object (Control on a Form) that is named [MODIFY_DAT]. Maybe you have a Field instead but that wouldn't work.
Attached Images
File Type: jpg ModuleTypes.Jpg (9.9 KB, 111 views)
File Type: jpg Macros.Jpg (17.7 KB, 110 views)
1 Week Ago #2
4 Nibble
@NeoPa, I believe you are correct about me using a field name. I'll let you know.
1 Week Ago #3
4 Nibble
Hi there,

Thanks for your advice.

So far, I've had no luck in getting this to work.

I've tried invoking the Builder to navigate to my form field, and also to the table field.
Like so:

With Text29 being tied to the Cables!MODIFY_DAT field, which is a Date field to show me when a Cable was modified.

It just simply isn't working, no matter what I do. I don't get it. I've never had any problems with this in my other databases, but then they are newer, and I think they are all Access2013 where this one is Access2000.

I also tried moving over to "After Update" on the Text29 field instead of "Before Update". It then allowed me to manually enter the date, but still wouldn't update on its own.

If you have any other advice, I'd appreciate it. Otherwise, I may try doing this with VBA.

Take care,
6 Days Ago #4
32,341 Expert Mod 16PB
If you have any other advice, I'd appreciate it. Otherwise, I may try doing this with VBA.
Frankly I still have far too little usable information to allow me to help you further along your current lines.

However :
Unless you have a compelling reason to do otherwise - use VBA.
6 Days Ago #5
4 Nibble
Thanks! I understand your dilemma, and trust me, I can appreciate it. I've run into situations before where I couldn't render an answer because the people I was trying to help didn't know enough to provide me the info I needed.

I really appreciate your efforts to help me, as well as the others around here. I see your name on a lot of posts here.

My VBA skills are rusty, but I probably can stumble through it. But frankly, I have spent too much time trying to figure this out, when I really could've just manually entered the dates and had the main project done by now.

Take care,
5 Days Ago #6
32,341 Expert Mod 16PB
You make a good point about knowing when to code & when to just get on with some grunt-work.

However, sometimes even going up a blind alley can allow you to pick up extra skills and understanding such that your next dilemma is based on a calculation weighted more towards coding an easier answer.

Personally I really hate grunt work. I'd rather work twice as hard coding something and smile every time I use it :-)
5 Days Ago #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Jerry | last post: by
2 posts views Thread by hph | last post: by
4 posts views Thread by andrewbda | last post: by
10 posts views Thread by Jes | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.