Form to show created/amended details? (1 Viewer)

Gasman

Enthusiastic Amateur
Local time
Today, 12:18
Joined
Sep 21, 2011
Messages
14,038
Hi all,

I have started adding fields to my tables for Created Date, Created Bty, Amended date and Amended By.

Rather than have these take up real estate on every form, I was thinking of having a common form that would be opened from a small button on each form, as I would probably only want to see this data when something goes awry. :D

What would be the chosen/best way to approach this please. ?

TIA
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:18
Joined
May 7, 2009
Messages
19,169
You can use Data macro. It diesnt need a form, transparent and akways git triggered.
 

Ranman256

Well-known member
Local time
Today, 08:18
Joined
Apr 9, 2015
Messages
4,337
i hide them as easter eggs.
usu there is a header label...CUSTOMERS...or whatever.
dbl-click the label ,and the window with that info pops.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:18
Joined
Sep 21, 2011
Messages
14,038
i hide them as easter eggs.
usu there is a header label...CUSTOMERS...or whatever.
dbl-click the label ,and the window with that info pops.

Ranman256,

It is how best to get the data into the new form, with the least code required in case of mods.?

Can I pass the record as an object, rather than 4 fields in OpenArgs

Pat Hartman mentioned in another thread (https://www.access-programmers.co.uk/forums/showthread.php?t=297855) that one did not need a control for the source, and I was trying to utilise that method to save having 4 fields, small and hidden on each form?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:18
Joined
May 7, 2009
Messages
19,169
I think it exists in a2k7.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:18
Joined
Sep 21, 2011
Messages
14,038
How about a listbox of all forms.
Select a form from the list to open a report with the details

You could adapt the example in this link:
https://www.access-programmers.co.uk/forums/showthread.php?t=295597

Hi Colin,
No I was thinking more of just the records of a form with a button (or Ranman256 label) that would show the details for a particular record. I want to be able to see the details of certain records to find out why something has gone wrong.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:18
Joined
Sep 21, 2011
Messages
14,038
I think it exists in a2k7.

From support.office.com ?

Data macros are a new feature of Access 2010 which enable you to add logic to events that occur in tables, such as adding, updating, or deleting data. They are similar to "triggers" in Microsoft SQL Server.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:18
Joined
Feb 19, 2002
Messages
42,970
You don't have to bind these fields to form controls. They only need to be in the form's RecordSource for you to populate them.

I rarely show these fields on forms because they just take up room. They are mostly for reference in case of a problem. If you want to give the user the option of seeing them but not waste the space, use a small button to pop up a message box that shows them if the user wants to see them.

MsgBox = "Changed By = " & Me.ChangedBy & " ON " & Me.ChangeDT
 

Mark_

Longboard on the internet
Local time
Today, 05:18
Joined
Sep 12, 2017
Messages
2,111
Alternate approach is to use a separate table to save this type of data. Table holds Updated Tables name, Updated Tables Primary ID, Date of change, Who made the change, and "Add/Edit/Delete" to show what they did. You can then make a small global piece of code to do this and simply pass the appropriate values from any form that can modify data.

This keeps it out of the hands of users and allows you to quickly identify who is doing what to what as its not spread over multiple tables.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:18
Joined
Sep 21, 2011
Messages
14,038
Hi Pat,
I remember you saying that in another thread where you helped me.
I tried in work and it kept complaining it could not find the data, yet I've just tried it on a form here at home and it works as you say.
I recall I had this problem then.
I'll try again on Monday in work.

Also the MSGBOX will be adequate for my needs.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:18
Joined
Sep 21, 2011
Messages
14,038
Alternate approach is to use a separate table to save this type of data. Table holds Updated Tables name, Updated Tables Primary ID, Date of change, Who made the change, and "Add/Edit/Delete" to show what they did. You can then make a small global piece of code to do this and simply pass the appropriate values from any form that can modify data.

This keeps it out of the hands of users and allows you to quickly identify who is doing what to what as its not spread over multiple tables.

Hi Mark,
Something to consider for later. The MSGBOX approach would be adequate for me at the moment, but I was over thinking it with using a form.
It is just that I have to take values from other systems, and sometimes people change data after I have taken it and do not let me know.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 08:18
Joined
Feb 19, 2002
Messages
42,970
I tried in work and it kept complaining it could not find the data, yet I've just tried it on a form here at home and it works as you say.
The case is different with reports. Were you perhaps working with a report back at the office?

With reports - Access recreates your RecordSource and includes ONLY columns that are actually bound to controls on the report. Therefore, with a report, you have to actually bind every column you need to reference. You can make the controls very small and set their visible property to no but they have to be there. For reports, I make all these fields YELLOW so they shout at me when I open the form so I recognize that they are actually hidden.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:18
Joined
Sep 21, 2011
Messages
14,038
No, purely forms.

Let me try again in work on Monday and I will report back.

Thank you.
 

Gasman

Enthusiastic Amateur
Local time
Today, 12:18
Joined
Sep 21, 2011
Messages
14,038
This slipped my mind. Sorry.:eek:
I now have it working.
 

Users who are viewing this thread

Top Bottom