in Ms Access how to make button go to previous form (1 Viewer)

harithdeans

New member
Local time
Today, 19:30
Joined
Feb 22, 2024
Messages
1
so basically i have two form which is adminform and auditform, and both has the fundingform. so if i want to put button to previous form at fundingform, how? I try many of solution live VBA and MAKRO but it does't go well. pls help me😭😭😭😭😭😭😭😭😭😭😭😭
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 04:30
Joined
Aug 30, 2003
Messages
36,125
I would pass the name of the calling form in OpenArgs and use that to return. Since you didn't post any of your efforts, we can't help fix them. ;)
 

plog

Banishment Pending
Local time
Today, 06:30
Joined
May 11, 2011
Messages
11,646
If fundingform is a subform on both adminform and auditform you can use it's Parent property to get which of those is it is currently showing on:,


Then use DoCmd.OpenForm to open the other:


If you get stuck, post the code you have tried and we will help more. I suggest using VBA and not a macro
 

CJ_London

Super Moderator
Staff member
Local time
Today, 12:30
Joined
Feb 19, 2013
Messages
16,613
If the funding form is a separate form pass the name of the calling form in openargs and in the funding form close event use docmd.openform to open the calling form
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 06:30
Joined
Feb 28, 2001
Messages
27,186
The basic rule is that Access won't tell you anything you didn't tell it first. Which means that you store the name of the "previous" form in the Form_Close event or Form_Unload event at the moment that you close the "previous" form and try to launch the other form. I.e. you have to TELL Access which form was "previous" because it doesn't normally "know" that you need that info.

OR... maybe you don't close the previous form at all. You launch the funding form, do your thing, and then exit from it. In which case the previous form is still there (but was in the background). When you click into that form that was in the background, it is still there and still open.

And one last bit of business... that was your first post. Welcome to the forum.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 07:30
Joined
Feb 19, 2002
Messages
43,275
I do this all the time. Here is a sample.

 

Users who are viewing this thread

Top Bottom