?
Solved

earliest time to declare a public variable

Posted on 2003-03-06
6
Medium Priority
?
143 Views
Last Modified: 2010-05-01
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.
0
Comment
Question by:tomdavid
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 11

Accepted Solution

by:
supunr earned 50 total points
ID: 8086019
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!
0
 

Author Comment

by:tomdavid
ID: 8086056
yes...that's assigning a value to a public variable from an Access table.

supunr...
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.
0
 

Author Comment

by:tomdavid
ID: 8086082
sunupr...
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. :)
0
Industry Leaders: 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!

 

Expert Comment

by:CleanupPing
ID: 8900543
tomdavid:
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?
0
 

Author Comment

by:tomdavid
ID: 8913935
i have found the solution to my question... as stated before, i have found it on the form load event.  Thanks every body.
0
 

Author Comment

by:tomdavid
ID: 8913938
sorry.... i would rather award the points to sunupr.  thank you very much to sunpr.  sorry for the late award. =)
0

Featured Post

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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question