944,082 Members | Top Members by Rank

Ad:
May 6th, 2007
0

a blank form to insert data????

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kasra is offline Offline
3 posts
since May 2007
May 6th, 2007
0

Re: a blank form to insert data????

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.
Reputation Points: 26
Solved Threads: 5
Junior Poster
scudzilla is offline Offline
191 posts
since Mar 2007
May 10th, 2007
0

Re: a blank form to insert data????

Click to Expand / Collapse  Quote originally posted by scudzilla ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kasra is offline Offline
3 posts
since May 2007
May 10th, 2007
0

Re: a blank form to insert data????

Click to Expand / Collapse  Quote originally posted by kasra ...
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
Reputation Points: 10
Solved Threads: 0
Light Poster
ReeciePoo is offline Offline
45 posts
since Apr 2007
May 10th, 2007
0

Re: a blank form to insert data????

yea, i think..it should work...but what are the connection info????....as long as i'm using data control...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
kasra is offline Offline
3 posts
since May 2007
May 11th, 2007
0

Re: a blank form to insert data????

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)
Reputation Points: 10
Solved Threads: 0
Light Poster
ReeciePoo is offline Offline
45 posts
since Apr 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Can someone please help with this?
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Out of Memory Exception





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC