Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beginner Question

Status
Not open for further replies.

stnkyminky

Programmer
Oct 15, 2001
476
US
I am attempting to use classes in a new project I'm working on.
I have a class called clsAdd. In clsAdd I store information about individual shipments, PO#'s, Addys, etc.
I instantiate a reference to clsAdd in a form called frmMain.
In frmMain I call a function in ClsAdd called PopulateFields. PopulateFields queries the DB and stores the individual results in the variables defined in ClsAdd. Once PopulateFields is complete the focus goes back to frmMain which does some other things then loads a form call frmAdd, which shows the result of the query.

frmAdd's Form_Load Event contains a reference to clsAdd and attempts to retrieve the values of clsAdd's variables and assign then to text boxes. When trying to assign the values to the text boxes, nothing is in the clsAdd variables.


What am I doing wrong? Scott
Programmer Analyst
 
Both your frames already have the object embedded, just assign it. Assuming your declared them as AddObject in both,
FrmMain should invoke frmAdd with
[tt]
Set frmAdd.AddObject = Me.AddObject
frmAdd.Show'... or Load
[/tt]


Wil Mead
wmead@optonline.net

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top