Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return to previous page 2

Status
Not open for further replies.

osi2301

Programmer
Jul 3, 2004
75
AU
In my access database, I have one page that can be accessed from two different locations. Is there anyway to make the datbase return to the page from which the user just came instead of to only one preselected page.
 
Are you talking about Data Access Pages and switching between pages in InternetExplorer?
 
Hi
How about using OpenArgs to store the sending form name? This could then be written to a hidden field and used with a command button. [ponder]
 
That sounds great but I'm a little vague on how to do that. Do you have some suggestions? I've never used the OpenArgs before.
 
Hi
Ok
frmA can be accessed from frmB or frmC
frmB has a command button with the following code:
[tt]DoCmd.OpenForm "frmA", , , , , , "frmB"[/tt]
Similarly frmC:
[tt]DoCmd.OpenForm "frmA", , , , , , "frmC"[/tt]

frmA has an OnOpen event:
[tt]Me!txtHidden = OpenArgs[/tt]
and a command button Back:
[tt]DoCmd.OpenForm Me!txtHidden[/tt]

Or there abouts!
 
That looks great and is so simple. Let me give it a go.
 
I tried the code. The
DoCmd.OpenForm "FrmA" , , , , , , "FrmB"
worked ok
However the
me!texthidden
would not work.
Im using access 2000 or 2002(I have both)
 
Hi
Me!txtHidden is a field on frmA with its visible property set to false. Is this what you have created? I was a bit abrupt in the explanation in my earlier post.
 
No I put me!texthidden = OpenArgs in the FrmA onOpen event procedure. However building an unbound field with me!texthidden = OpenArgs in the data property isn't working either. It returns an error message "NAME?".

When docmd.me!texthidden is inserted into the return command button of FrmA, it is not being recognised by access as a valid command.
 
Why not simply this in the Click event procedure of the Back button:
DoCmd.OpenForm Me.OpenArgs

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi
Put an unbound textbox on the form frmA and call it, for example, texthidden. Then put a line in the OnOpen Event of frmA:
Me!texthidden = OpenArgs

I hope this clarifies things! :)
 
I put this in the on click property of the back button of FrmA: DoCmd.OpenForm Me.OpenArgs. I added an unbound field to FrmA and named it "texthidden" FrmB has the following in the on click property: DoCmd.OpenForm "FrmA", , , , , , "FrmB, which opens FrmA correctly from FrmB but the back button of FrmA returns the following error message "The expression you entered refers to a an object that is closed or doesn't exist
 
sorry folks,
After some experimentation, I've got it to work. I was trying to apply the helpful hints of both and got it all screwed up. PHV was spot on. You don't need the unbound field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top