473,385 Members | 1,813 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,385 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 12274
NeoPa
32,556 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, 320 views)
File Type: jpg Macros.Jpg (17.7 KB, 276 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,556 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,556 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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.