hi every1..
i have a form with a register butoon...when the button is pressed, the registration form (which is connected to ms access) opens...but the problem is that the form displays the data stored in table..although i need a blank form, which allows users to insert data...

any emergency reply appritiated...
tnx in advance

Recommended Answers

All 5 Replies

If there are any textboxes in the form (which I'm sure there are), don't connect them to the database. Then if there is a button that adds the data into the database, then get the data from the textboxes then add them to the database.

If there are any textboxes in the form (which I'm sure there are), don't connect them to the database. Then if there is a button that adds the data into the database, then get the data from the textboxes then add them to the database.

hello..for the process that u mentioned, i have 2 open a connection in click event of that button and assign every text box to database with a recordset...right???...but how can i do that??//...bcz i'm really new to VB and i gotstuck...:(
help me plz...tnx

hello..for the process that u mentioned, i have 2 open a connection in click event of that button and assign every text box to database with a recordset...right???...but how can i do that??//...bcz i'm really new to VB and i gotstuck...:(
help me plz...tnx

I use
Dim rstRecordSet As RecordSet

'Connection Info Here' Make sure you open the database to "Write"

With rstRecordSet
.AddNew
.Fields(0) = Text1.Text
.Fields(1) = Text2.Text
.Fields(2) = Text3.Text
.Fields(3) = Text3.Text
.Update
End With

^^ That should be your answer? not sure if thats what you wanted but let me know

yea, i think..it should work...but what are the connection info????....as long as i'm using data control...

Dim conConnection As New ADODB.Connection
  Dim cmdCommand As New ADODB.Command
  Dim rstRecordSet As New ADODB.Recordset


  'Defines the connection string for the Connection.  Here we have used fields
  'Provider, Data Source and Mode to assign values to the properties
  ' conConnection.Provider and conConnection.Mode

  conConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
      App.Path & "\" & "database.mdb;Mode=Read|Write"


  'Define the location of the cursor engine, in this case we are opening an Access database
  'and adUseClient is our only choice.

  conConnection.CursorLocation = adUseClient


  'Opens our connection using the password "Admin" to access the database.  If there was no password
  'protection on the database this field could be left out.

  conConnection.Open

That will open a connection for you, change to what you please (the file name i mean)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.