VB Project with Access DB help making a New Record
Hello Everyone, i am using VB to make a front end of my Access database.
But i cant seem to make a button so that when you click it, it erases all the fields, and then lets the user enter a new record, here is my code, it keeps saying i cant do anything while the record is closed.
Thanks for your help everyone
Private Sub AddNew_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text11.Text = "Comments"
Set rs = Nothing
Set rs = New adodb.Recordset
End Sub
Re: VB Project with Access DB help making a New Record
Quote:
Originally Posted by joefox
Hello Everyone, i am using VB to make a front end of my Access database.
But i cant seem to make a button so that when you click it, it erases all the fields, and then lets the user enter a new record, here is my code, it keeps saying i cant do anything while the record is closed.
Thanks for your help everyone
Private Sub AddNew_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text11.Text = "Comments"
Set rs = Nothing
Set rs = New adodb.Recordset
End Sub
Just clear your textboxes in this event. Deal with your recordset object in the code you have that actually does the adding.
Re: VB Project with Access DB help making a New Record
Hello,
I am new at this, and i dont really get what you said lol
sorry