How to reference SetValue in AutoExec Macro using MsgBox Response?

Maxis37

Registered User.
Local time
Today, 05:27
Joined
Jul 10, 2013
Messages
20
In AUTOEXEC Macro I have

Action = SetValue
Item = [UserResponse]
Expression = MsgBox("Confirm xyz",4)

next macro step

Action = RunCode Login()
CONDITION = [UserResponse]=6

How do a reference the SETVALUE sent back from the MsgBox in the CONDITION column of the RunCode Login()? 6 is Yes, 7 is No.

It has to work in both Access 2003 and Access 2010.​
 
By adding it as VBA to the beginning of Login() instead?

Code:
Public Function Login()
Dim varResponse as Variant
...

varResponse = MsgBox("Confirm xyz", vbYesNo)
...

If varResponse = vbYes Then
  ...
Else
 ...
Endif

...
 
the vba will NOT run BEFORE the user selects ENABLE MACRO button.... we need code that will tell if its a win XP/access2003 user or a WIN 7/access 2010... almost anything (including the vba) works for the XP/access2003 users, but the Win 7/access 2010 users and the whole "trusted site" issue can't run any vba code until after they select the ENABLE MACROS on the Security Warning line when ACCESS first comes up. We're trying for ONE autoexec that will run in both environments, but insure the Win7/access2010 user always selects the ENABLE MACRO (.istrusted).

i think the best answer i've received so far is two separate front-ends with the only difference being what autoexec is saved. the xp/access 2003 users just run code login(), the win7/access2010 users test for .istrusted, an once they select ENABLE MACRO, then they run the login() too.

We're must trying to avoid having the two front-ends, more steps to move something to production, etc. etc.
 

Users who are viewing this thread

Back
Top Bottom