Help needed with AllowEdits logic

  • Thread starter rashar via AccessMonster.com
  • Start date
R

rashar via AccessMonster.com

Hello,

I have a form called FormA that allows a user to enter a quantity. If they
enter a quantity of say greater than 5, another form pops up. What I want to
accomplish is when FormB pops up I don't want the user to be able to edit
FormA until FormB is closed.

Here is what I've tried.

'When Quantity > 5 then...
Me.AllowEdits = False
DoCmd.OpenForm "FormB"

'On the close event of form B, set AllowEdits on FormA to true to resume
editing...
Dim frm As Form
Set frm = Forms!FormA
frm.AllowEdits = True

After running the above logic no errors are returned, however, I am unable to
edit FormA.

Thanks in advance.
 
A

Allen Browne

Open the 2nd form in dialog mode:
DoCmd.OpenForm "FormB", WindowMode:=acDialog
 
K

Krzysztof Naworyta

Dialog mode is unnecessary... I allmost never use it, because this makes
form popup at once, without possibility to use manubars The only thing is
to open formB as modal:

DoCmd.OpenForm "FormB"
Forms("FormB").Modal = True

--
KN

Juzer Allen Browne <[email protected]> napisaÅ‚
| Open the 2nd form in dialog mode:
| DoCmd.OpenForm "FormB", WindowMode:=acDialog
|
|
| || Hello,
||
|| I have a form called FormA that allows a user to enter a quantity. If
|| they enter a quantity of say greater than 5, another form pops up.
|| What I want to
|| accomplish is when FormB pops up I don't want the user to be able to
|| edit FormA until FormB is closed.
||
|| Here is what I've tried.
||
|| 'When Quantity > 5 then...
|| Me.AllowEdits = False
|| DoCmd.OpenForm "FormB"
||
|| 'On the close event of form B, set AllowEdits on FormA to true to
|| resume editing...
|| Dim frm As Form
|| Set frm = Forms!FormA
|| frm.AllowEdits = True
||
|| After running the above logic no errors are returned, however, I am
|| unable to
|| edit FormA.
||
|| Thanks in advance.
||
|| --
||

--
KN

archiwum grupy:
http://groups.google.pl/advanced_search
(grupa: pl*msaccess)
 
R

rashar via AccessMonster.com

Thanks for the solutions. They worked perfect!

Krzysztof said:
Dialog mode is unnecessary... I allmost never use it, because this makes
form popup at once, without possibility to use manubars The only thing is
to open formB as modal:

DoCmd.OpenForm "FormB"
Forms("FormB").Modal = True

--
KN

Juzer Allen Browne <[email protected]> napisaÅ‚
| Open the 2nd form in dialog mode:
| DoCmd.OpenForm "FormB", WindowMode:=acDialog
[quoted text clipped - 27 lines]
|| --
||
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top