Microsoft KB Archive/172100: Difference between revisions
(importing KB archive) |
m (Text replacement - """ to """) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 57: | Line 57: | ||
In the Form's Load, instead of: | In the Form's Load, instead of: | ||
<pre class="codesample"> Text1.Text = | <pre class="codesample"> Text1.Text = "This text should be in the text box." | ||
</pre> | </pre> | ||
use: | use: | ||
<pre class="codesample"> Data1.RecordSet( | <pre class="codesample"> Data1.RecordSet("<field name>") = "Text to show." | ||
</pre> | </pre> | ||
Line 93: | Line 93: | ||
<pre class="codesample"> Data1.Refresh | <pre class="codesample"> Data1.Refresh | ||
Data1.Recordset.AddNew | Data1.Recordset.AddNew | ||
Text1.Text = | Text1.Text = "This text should be in the text box." | ||
</pre></li> | </pre></li> | ||
<li>Run the form.</li></ol> | <li>Run the form.</li></ol> |
Latest revision as of 11:05, 21 July 2020
Article ID: 172100
Article Last Modified on 1/8/2003
APPLIES TO
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
- Microsoft Visual Basic 5.0 Control Creation Edition
- Microsoft Visual Basic 5.0 Learning Edition
- Microsoft Visual Basic 5.0 Professional Edition
- Microsoft Visual Basic 5.0 Enterprise Edition
This article was previously published under Q172100
SYMPTOMS
When a form is run, a bound Text box comes up blank even though a value is being stored to it's Text property in the Form's Load. In prior version of Visual Basic, the Text box came up populated if done in this manner.
RESOLUTION
In the Form's Load, instead of:
Text1.Text = "This text should be in the text box."
use:
Data1.RecordSet("<field name>") = "Text to show."
STATUS
Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Behavior
- Create a new Project.
- On the new form, add a TextBox control and a DataControl.
Set the following DataControl's properties as shown:
Data1 .DatabaseName = nwind.mdb .RecordSource = customers
Set the following Text Control's properties as shown:
Text1 .DataSource = Data1 .DataField = contactname
Place the following code in the Form's Load Method:
Data1.Refresh Data1.Recordset.AddNew Text1.Text = "This text should be in the text box."
- Run the form.
Additional query words: empty kbVBp500 kbVBp600 kbdse kbDSupport kbVBp
Keywords: kbprb KB172100