Discussion Locked

VB - adodc

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i bounded my form to an adodc data control, when i deleted a record and requery, first record will be displayed on my form, now i would like all the textbox on my form to be emptied first(blank screen) after i deleting a record and when i pressed the navigator button on my adodc, my form should display the last record, it is any possible way of doing it??

Please Help!!

7 replies

by miss kitty

after your delete, go to a sub to clean out your text boxes like the example below.

Private Sub ClearTextBoxes()
'clear all text boxes
txtName.Text = ""
txtCustid.Text = ""
txtAlphasort.Text = ""
txtStreet.Text = ""
txtCity.Text = ""
txtState.Text = ""
txtZip.Text = ""
txtContact.Text = ""
txtCashOnly.Text = ""
txtFax.Text = ""
txtPhone.Text = ""
txtSalesper.Text = ""
txtTerms.Text = ""
End Sub

by dushy_ant

This is a very vague kind of a problem and i think there is no solution for this.
But u can workaround this problem by removing the datasource of the text boxes to nothing and then reassigining them when u navigate

by carquiza

Hi whyong,

Try if you could use this:
Dim Control
For Each Control In Form1.Controls
If TypeOf Control Is TextBox Then Control.Text = ""
Next Control

Place this code on the under Private Sub Form_Load() and make sure that your form name is "Form1"
Hope this works for you.

Cheers,

Mel Arquiza
Home Page Design
http://hpd.welcome.to

This discussion is closed to new replies.