Passing Variables without using WindowHide

R

redfox05

Regarding thread:
http://groups.google.co.uk/group/mi...read/thread/3d766ca25e88876c/1a479bd09f4d6315

Out of date, but for all those A Level students who would find this
useful it may help.

I used a hidden form to pass a control value.
But then changed it to use global variables, as according to the above
thread.

But, to display the variable I did it differently.

I used an Onload on the form itself, and included the following:

Private Sub Form_Load()
Me.TextField = globVariableName
End Sub

This worked much better, because using a function to call the variable,
as mentioned in the thread, caused a delay in the value appearing,
maybe a second or two, but still does not show up on the form straight
away.

But using VB to set the value directly made the value show up
immediately.

Only drawback is that you do have to set the value in VB code and not
in the dialog boxes in Access. (Or at least Ive not found that you can)
When using this method, you have to leave the Control Source for the
textbox empty.

Anyways, hope this helps. Im only new to using VB, but parts of my
Access project required me to use VB (one of which is this passing
variables example), so I have to learn a bit.

If im wrong in any of this, let me know, im only just beginning in VB.

Russell
 
P

Peter R. Fletcher

That's a useful tip.

Regarding thread:
http://groups.google.co.uk/group/mi...read/thread/3d766ca25e88876c/1a479bd09f4d6315

Out of date, but for all those A Level students who would find this
useful it may help.

I used a hidden form to pass a control value.
But then changed it to use global variables, as according to the above
thread.

But, to display the variable I did it differently.

I used an Onload on the form itself, and included the following:

Private Sub Form_Load()
Me.TextField = globVariableName
End Sub

This worked much better, because using a function to call the variable,
as mentioned in the thread, caused a delay in the value appearing,
maybe a second or two, but still does not show up on the form straight
away.

But using VB to set the value directly made the value show up
immediately.

Only drawback is that you do have to set the value in VB code and not
in the dialog boxes in Access. (Or at least Ive not found that you can)
When using this method, you have to leave the Control Source for the
textbox empty.

Anyways, hope this helps. Im only new to using VB, but parts of my
Access project required me to use VB (one of which is this passing
variables example), so I have to learn a bit.

If im wrong in any of this, let me know, im only just beginning in VB.

Russell

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 

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