473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Attendance register for a farm

Hi I am a self thought in access and been creating a couple of data bases for my farm.I am now building a attendance register and is keeping it as simple as possible.Table is as follow:
id(auto) : Date (=now()) : Employee 1 : Employee 2 : Employee 3 ................

What I need is to insert the value 1 into the field when a command button is clicked.The plan is to make a command button with the employee's picture on it that needs to be clicked for attendance.I am working with un schooled staff that doesn't know any thing about pc's.
The expression that I have tried is : on click : = [employee 1] = 1 but with no luck!
Mar 17 '07 #1
4 2348
MMcCarthy
14,534 Expert Mod 8TB
Hi I am a self thought in access and been creating a couple of data bases for my farm.I am now building a attendance register and is keeping it as simple as possible.Table is as follow:
id(auto) : Date (=now()) : Employee 1 : Employee 2 : Employee 3 ................

What I need is to insert the value 1 into the field when a command button is clicked.The plan is to make a command button with the employee's picture on it that needs to be clicked for attendance.I am working with un schooled staff that doesn't know any thing about pc's.
The expression that I have tried is : on click : = [employee 1] = 1 but with no luck!
You need two tables. One with a list of Employees and the other for attendance as follows

tblEmployee
EmpNum (Primary Key - Autonumber)
EmpName

tblAttendance
AttendID (Primary Key - Autonumber)
DateWorked
EmpNum (Foreign Key Reference to tblEmployee)

Now in the button On Click Event
Expand|Select|Wrap|Line Numbers
  1. Private Sub BtnName_Click()
  2. Dim strSQL As String
  3.  
  4.    strSQL = "INSERT INTO tblAttendance ([DateWorked], [EmpNum]) " & _
  5.       "VALUES (" & Now() & ", " & 1 & ");"
  6.    DoCmd.RunSQL strSQL
  7.  
  8. End Sub
  9.  
Mary
Mar 17 '07 #2
Thank you for the reply
This sounds stupid but in witch form must the button be?
1) The tblAttendance form or a new form?
I tried the a new for with just the button on it but if I run the code I get a Run-time error '3075'
Syntax error (missing operator)
What I rather would like to do is having a table with the names of the employees in each column and the date as auto.
i.e..
tbl Attendance:

ID : (auto nr)
Date : (=now())
Peter : (data type , number)
John ;(data type , number)
Jack(data type , number) .......

The fields it self would not be visible on the form but only the Pictures of the employee's.
When button click the value 1 would be inserted in to the corresponding field.
Only reason I use the value 1 is that at the end of the month I will add each column together to get the days worked for a month.
To be honest I don't know much about coding but are learning at a huge pace. :)

Ps.The form will be auto loaded when access starts up and after the form is updated it will close and open the control form.
Mar 18 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Try this ...
Expand|Select|Wrap|Line Numbers
  1. Private Sub BtnName_Click()
  2. Dim strSQL As String
  3.  
  4.    strSQL = "INSERT INTO tblAttendance ([John]) " & _
  5.       "VALUES ("& 1 & ");"
  6.    DoCmd.RunSQL strSQL
  7.  
  8. End Sub
Just change the column name for each button.
Mar 20 '07 #4
Hi I am a self thought in access and been creating a couple of data bases for my farm.I am now building a attendance register and is keeping it as simple as possible.Table is as follow:
id(auto) : Date (=now()) : Employee 1 : Employee 2 : Employee 3 ................

What I need is to insert the value 1 into the field when a command button is clicked.The plan is to make a command button with the employee's picture on it that needs to be clicked for attendance.I am working with un schooled staff that doesn't know any thing about pc's.
The expression that I have tried is : on click : = [employee 1] = 1 but with no luck!
hi..am also doing same,if u have a correct code,can u please share me this..
please reply..thanks in advance..
Oct 15 '07 #5

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

Similar topics

2
by: crier_67 | last post by:
Hello all, I'm relatively new to Access and could use some direction on this task. I have a group with a FoxPro 2.6 for DOS membership & attendance database with about 200 member records. ...
0
by: shun | last post by:
Hello I strated a project "attendance register". consiists of user login and logintime and logout time using ASP.net. can any one help me, or any sites which have free source code about this....
1
by: Shun | last post by:
Hello, My requirement is to develop an Employee Attendance Register. For ex: I am in some X country and my office is in Y country. now my requirement is i want to check the employees present...
0
by: spattarkine | last post by:
How to create daily attendance system for students which create warning after each 3 absents.idea is as soon as the class and section are selected,names and roll no of all the students of that class...
2
by: timgeitz | last post by:
I would like to design a drop down option box on a form which gives me several choices for putting in an attendance date to record church attendance. Typically, a church secretary would record a...
0
by: Bill | last post by:
I've searched comp.databases.ms-access for a solution and found help but still haven't got my problem solved. I want to record weekly attendance and print an attendance "check off" sheet where...
3
by: pardhu | last post by:
I just need the code for this plz help me
5
by: Lindie | last post by:
We use a spreadsheet to record attendance for pupils with special needs. They live-in so we need 365/365 attendance details. The spreadsheet is getting too cumbersome, a Db is needed. I would...
1
by: aajayaprakash | last post by:
Am so glad someone atleast wroteback ! I am trying to set up an attendance register where time someone comes into an office and leaves is recorded...a php based timecard/punchcard kind of thing. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.