-
Access Questions
Hello all,
I wonder if you could point me in the right direction with the following questions, I am building an application with a Access backbone:
1. I want to create a button that can be clicked to create a blank new form.
2. A button to delete the current form.
Your help would be appreciated.
Adrian Harris
-
I may be misunderstanding your question but this will open a new blank form.
Code:
Private Sub Button4_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button4.Click
' Create new instance of a form and then show it.
Dim frmNew As New Form
frmNew.Show()
End Sub
If you have a prebuilt form you would like to open you would name it in the Dim statement like this. Dim frmNew As New myForm. That assumes your prebuilt form is named myForm.
To close the current form you would do this.
Code:
Private Sub Button5_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button5.Click
' Close current form
Me.Close()
End Sub
-
Thanks for the help.
What I am after is the code to delete and create new lines in the Access database.
-
Are you using Visual Studio.Net or Visual Basic.Net? There is a dataform wizard in both that should do all the work for you.
You can modify the created code to work in your own projects or use it exactly the way the demo creates it.
-
I'm using Visual Basic.net. Where is the dataform wizard located?
-
In Visual Basic.Net you have to have a project open already. Under the Edit in the file menu there is a Icon that looks like an open window with smaller icons in it.
Press that and the Add New Item menu should come up. You should see the Data Wizard Form in there. The rest is self explanitory.
By the way, you can use VB.Net with the full version of SQL if you do the code yourself. All the wizards kinda give you the idea that you can't use SQL server with the standard version of VS. <--- Many people are not aware of that so I was just letting you know in case you didn't either.