Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 145
  • Last Modified:

earliest time to declare a public variable

i just want to know when's the earliest and best time to declare a public variable whose value would come from an Access table.

how? thanks.
  • 4
1 Solution
mmm...I am not sure what exactly you mean in this question.  But if you want to assign a value to a public variable, first time to assign is Form_Load event.  If however you have a Main function, then you can assign the value within Main function before calling any forms or functions.  Hope this help.  Good Luck!
tomdavidAuthor Commented:
yes...that's assigning a value to a public variable from an Access table.

As i'm using a data control on the form, i think it can not be done on Form_Load since the datacontrol is not yet loaded when this procedure is called.

now, how is it done on Main?  Where will I put this procedure? on a Module xxx.bas? or on the form itself?  Thanks.
tomdavidAuthor Commented:
sorry. i got it. i had it on Form_Load. I just had to call datacontrol.Refresh and then assign the value to the public variable.

thanks sunupr... i award you the points. :)
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
tomdavidAuthor Commented:
i have found the solution to my question... as stated before, i have found it on the form load event.  Thanks every body.
tomdavidAuthor Commented:
sorry.... i would rather award the points to sunupr.  thank you very much to sunpr.  sorry for the late award. =)

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now