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.
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]
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.
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.