[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VB and Access Table

Posted on 2000-04-04
3
Medium Priority
?
184 Views
Last Modified: 2010-05-03
New to VB and I want to edit an Access
table in the database. When a form opens I want set an entire field (a check box) to false.
The db name: NTK_Memebers.mdb
The table name: Kart_Driver_Data
The field name: Enter_Race

I don't have a clue where to start.
Any help would be appreciated!
Thanks, Bob Schabel
0
Comment
Question by:bob_schabel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:riduce
ID: 2685520
An Example

Project > Components > Mark : Data grid control 6.0


add an datgrid to you're form set the property datasourse = data1
add data1 to you're form type by the property recordsource          Kart_Driver_Data


Private Sub Form_Load()
data1.databasename = "Kart_Driver_Data"
data1.Refresh
End Sub



0
 
LVL 6

Expert Comment

by:Marine
ID: 2685543
Make the Field to be Yes/No type.

Then for whatever number of records you have set it to false. I think this will do it.
Dim cn as New AdoDb.Connection
I assume that the connection is properly opened. Then do this.
sSql = "UPDATE Kart_Driver_Data SET Enter_Race = false WHERE Enter_Race=True"
cn.Execute sSql,iCount
cn.close
0
 
LVL 3

Accepted Solution

by:
Elmo_ earned 200 total points
ID: 2685787
Here is the answer ya need.

Declare these three variables, If they do not appear you will have to add in the data
control component or reference file, (In the project menu)

Dim WS1 As Workspace
Dim Datab As Database
Dim RecSet As Recordset

Dim DBName As String

'Put the database in the same directory as the project file (Or give the full path)
DBName = App.Path & "\NTK_Memebers.mdb"

'This sets up a workspace then creates a database within the workspace and then opens up a
'recordset within the database.  The record set is connected to your table

Set WS1 = DBEngine.CreateWorkspace("dbTemp", "admin", "")
Set Datab = WS1.OpenDatabase(DBName)
Set RecSet = Datab.OpenRecordset(Kart_Driver_Data, dbOpenDynaset)

'you can use recset.movefirst, recset.movenext , recset.moveprevious, recset.movelast to
'scroll through these recs.  
with recset
      .edit
      .Fields("Enter_Race") = 1
      .update
      .Bookmark = .LastModified
end with

Any problems leave a message.

Elmo_
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question