reopen form (1 Viewer)

SzymonK

New member
Local time
Today, 10:40
Joined
Mar 29, 2022
Messages
14
Hi All I heve two forms : FormNavigation

View attachment 99705
and Form1 , using for inputting data for day and night shift.
I entered the data into the form today, but I closed by accident. After opening the form, access again generated a new record. I would like to open the previous one by pressing button. Here's an example of macro which doesn't work:
1649169409442.png

Do you have any idea what is wrong?
 

Attachments

  • 1649168993610.png
    1649168993610.png
    20.8 KB · Views: 168

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:40
Joined
May 7, 2009
Messages
19,230
you need to go to Design view of your form and Set DataEntry to No, to be able to goto a record.
 

SzymonK

New member
Local time
Today, 10:40
Joined
Mar 29, 2022
Messages
14
Hi arnelgp.
Thanks for reply.
DataEntry is setup for No.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:40
Joined
May 7, 2009
Messages
19,230
you can set the Where Condition:

="[ShiftDate] = #" & Format(DMax("ShiftDate", 'yourTableName"), "mm/dd/yyyy") & "#"
 
Last edited:

SzymonK

New member
Local time
Today, 10:40
Joined
Mar 29, 2022
Messages
14
="[ShiftDate] = #" & Format(DMax("ShiftDate", 'yourTableName"), "mm/dd/yyyy") & "#"
I'm sorry that I'm bothering you.Is working fine; however, I noticed that I do not necessarily save the last record. The database is in SharePoint, and users have FrontEnd. Many people from different departments will use this form. Is it possible to add something to this macro to show the record based on date (already working) and SiteID?
something like:
="[ShiftDate] = #" & Format(DMax("ShiftDate", 'yourTableName"), "mm/dd/yyyy") & "#"+ SiteID from "yourTableName")
Please, do you know how to solve it?
Thank You
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:40
Joined
Oct 29, 2018
Messages
21,467
I'm sorry that I'm bothering you.Is working fine; however, I noticed that I do not necessarily save the last record. The database is in SharePoint, and users have FrontEnd. Many people from different departments will use this form. Is it possible to add something to this macro to show the record based on date (already working) and SiteID?
something like:
="[ShiftDate] = #" & Format(DMax("ShiftDate", 'yourTableName"), "mm/dd/yyyy") & "#"+ SiteID from "yourTableName")
Please, do you know how to solve it?
Thank You
Hi. Sorry for jumping in, @arnelgp might be on break. You could try something like:
Code:
="[ShiftDate] = #" & Format(DMax("ShiftDate", 'yourTableName"), "mm/dd/yyyy") & "# AND SiteID=" & Forms!FormName.SiteID
That assumes the SiteID info is available from an open form. Otherwise, we'll need to know where to get it from to fix the code.
 

Users who are viewing this thread

Top Bottom