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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Initialising a New Dialog with Data

Status
Not open for further replies.

Jastper

Programmer
Oct 4, 2002
13
0
0
GB
I want to initialise a New Dialog box with database information from the original form but am not finding it as straight forward as I thought. I have listed the code that the problem is related to:

void CMy19_02_03View::On_AMEND_RECORD()
{
Update_DLG d;
d.m_UPDT_Family_Name = m_Family_Name;
d.DoModal() ;
UpdateData(0);
}

Update_DLG is the new class for the new dialog box and m_Family Name is an edit box on the original form displaying a record from an MS ACCESS DB file. Any help will be most usefull.

When the program is run no data is displayed in the new dialogs edit box (m_UPDT_Family_Name)
 
Where I assume 'm_UPDT_Family_Name' is a variable of type CString setup via the class wizard. Try deleting this variable in the class wizard and adding it again with the category 'Control' and the variable type 'CEdit'.

In your code set the edit text's value by doing;
m_UPDT_Family_Name.SetWindowText( m_Family_Name );
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top