473,287 Members | 1,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 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).

Videot7
Aug 2 '22 #1
6 12245
NeoPa
32,554 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, 318 views)
File Type: jpg Macros.Jpg (17.7 KB, 273 views)
Aug 2 '22 #2
Videot7
4 Nibble
@NeoPa, I believe you are correct about me using a field name. I'll let you know.
Thanks,
Videot7
Aug 2 '22 #3
Videot7
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,
Fred
Aug 3 '22 #4
NeoPa
32,554 Expert Mod 16PB
Videot:
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.
Aug 4 '22 #5
Videot7
4 Nibble
@NeoPa,
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,
Videot7
Aug 4 '22 #6
NeoPa
32,554 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 :-)
Aug 4 '22 #7

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

Similar topics

3
by: usenet | last post by:
I have inherited a table where date information was saved from PHP as a VARCHAR. (Sigh.) This means that the so-called date fields look like this : August 1, 2005, 9:09 am EDT October 13, 2004,...
2
by: Jerry | last post by:
I'm trying to automatically fill in the date field in a <FORM>. I've found a couple scripts, both of which work fine in IE, but display the year part as "106" rather than "2006" when viewed with...
2
by: hph | last post by:
Please be gentle; I am a relative newbie for php/MySQL, and most of what I am doing is based on being self-taught using someone else's well-written code, and my own googling the answers to my...
4
by: andrewbda | last post by:
I have tickbox on a form, and I would like to use a date field as the control source. i.e. I would like to have it display as ticked when a date exists in the field, and vice versa. Also,...
10
by: Jes | last post by:
Dear all I have a date field on a HTML form where the user is asked to key in dd/mm/yyyy However, when that is written to MySql it is either not accepted or another value is tored in the...
8
by: printline | last post by:
Hello all I have a form, where the user can choose how many delivery days he wants on his order. Lets say he chooses 2 days. Can i in some way put in a script that automatically sets in the...
2
by: Supermansteel | last post by:
Our team does numerous tests each month. Each person can run a report to automatically tally up all the results for the quarter. I have then created a Form specifically to enter our Analysis for the...
12
by: klbrownie | last post by:
Hello, I am trying to get a date field to autofill based on the date of another date field. I want the autofilled date to be 30 days after the other date. For example, if the user has entered...
3
by: bryman | last post by:
I haven't experienced this problem of assigning Date or Now to a date field's default property so the form shows the current date. Of course, this is to help ease data entry for the user. The...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.