472,958 Members | 2,358 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 12094
NeoPa
32,547 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, 305 views)
File Type: jpg Macros.Jpg (17.7 KB, 265 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,547 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,547 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
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.