By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,543 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

Inserting collected data into a access database

P: 3
Hi Guys,

I am very new to VB. I am working on a project for class that will let people sign in to a fitness center and sign out.

I have no clue what I am doing. I have searched and read and read and I can't seem to figure out how to insert data that I collect on a form I created into an Access database.

I know I can do it if I drag and drop the tables onto the form but I need for the form to make sure the user exists before submitting the data. Here is the project

Access Database 3 Tables

The WhoIsHere table has three fields:

Users table:

History table

Now, I have created 4 forms

A welcome form which shows a Sign In and a Sign Out and a Register Button

Sign In
One textbox (for the user to scan the ID) this is where I am stuck... I need upon scan to make sure the user exists by looking up the ID in the Users Table and if they do exist I need them inserted into the WhoIsHere Table with the date and time.

My goal is to move the record from the WhoIsHere upon signout to the History table and insert a time out.

Can someone please help me out? If I can see how this is done I should be able to figure out how to do the rest.

I would be willing to pay for some help if need be. Just let me know. I work best from examples.

Sep 8 '07 #1
Share this Question
Share on Google+
2 Replies

P: 3
Why doesn't this work? I have this assigned to a button:

Expand|Select|Wrap|Line Numbers
  1. Dim con As New OleDb.OleDbConnection
  2.         con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\leightr\My Documents\Visual Studio 2005\Projects\cma\cma\culverflex.mdb"
  3.         Dim da As OleDb.OleDbDataAdapter
  4.         Dim signInNow As String
  5.         con.Open()
  6.         signInNow = "INSERT INTO `whoishere` (`userid`, `timein`, `signdate`) VALUES (10, 12:00:30 PM, 12/22/81)"
  7.         da = New OleDb.OleDbDataAdapter(signInNow, con)
  8.         con.Close()
Sep 8 '07 #2

P: 3
Well, I have figured out how to insert the data from a form into Access.

Now I need help with:

How do I look up a record based on input of a textbox (userid) and move it to another table?
Sep 8 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.