Newbie Moving Text between Data bound textboxes
Kevin:
Let's say you have 2 ADO DataControls (Adodc1 and Adodc2) feeding
Text1 and Text2 respectively. Somewhere in your code (I need more
details to be able to say exactly where) you could check the status of
the Adodc1.RecordSet.EOF property:
If Adodc1.RecordSet.EOF Then
Set Text1.DataSource = Adodc2
Text1.DataField="SomeFieldInTheAdodc2Recordset"
Text1.Refresh
else
Set Text1.DataSource = Adodc1
Text1.DataField="SomeFieldInTheAdodc1Recordset"
End If
bear in mind, however, that when Adodc1.RecordSet.EOF you will be
updating the Adodc2.RecordSet !!
*Alternately*, if you indeed want to transfer the data displayed in
Text2 to Text1, then you'll need to update the underlying recordset
"behind" Text1:
If Adodc1.RecordSet.EOF Then
Adodc1.RecordSet.AddNew
Adodc1.RecordSet("SomeFieldInTheAdodc1Recordset") = _
Adodc2.RecordSet("SomeFieldInTheAdodc2Recordset")
Text1.Refresh
End If
Regards,
-Toby
On Tue, 5 Dec 2000 03:53:45 +0100, "Kevin Schaaps"
Quote:
>Greetings,
>I really need help with this. I hope you are willing and able to help me :)
>I have 2 textboxes let's call them Text1 and Text2 :)
>Both are Data Bound (Using the DataEnviroment)
>The difference between them is that they are bound to different recordsets.
>Text1 should hold the data, but it can happen that it's empty. If this is
>the case I want it to look at Text2 and retrieve the data from that box.
>What I need help with is, how do I copy the (database) data from one textbox
>to another.
>Something similar as to: Text1.text = Text2.text (this doesn't work with
>data bound controls)
>PLEASE help me with this
>Yours,
>Kevin