473,387 Members | 1,844 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,387 software developers and data experts.

Close Form and update record in Table on field change

Please excuse any idiotic questions as Access/VBA is a new area to me.
I have inherited an Access Database/Application that is used to sign in and out visitors and Staff to our community Centre.
The system works fine and with the addition of extra screens(forms) we have managed to get it to work using touchscreen monitor and an OSK.
I was looking at using a Barcode Font (Free 3 of 9 Extended)to simplify signing in and out for Staff, and also so we are not showing list of signed in people on screen.
So how it works.
A visitor or staff member is presented with a screen offering choice of Visitor or Staff Member, whichever choice is made takes it to another screen (Form) that asks to sign in or Sign out.
In the Sign Out section a Staff Member Scans their ID badge (with Barcode and Numeric Staff ID) the form has an Unbound Text Box which has Focus when the Form is opened, after scanning ID Badge the next field (FullName) is Populated with The Staff ID No from Badge Barcode using a Search Record Macro with Control source [BadgeID], this then brings up the previous record from when they Signed in.
So Far so good. But this is where I am lost, I have a close Buttton (toggle Button) on the Form which closes the form but the record in the Table does not alter. The form is bound to table VisitorSigninOut. I have a Field in the Table called SignedOut and a Field called TimeOut, when the Form is opened in Edit mode these are the two fields on the form that are not on the Sign In form so I thought they would be added to the earlier record, but they don't. However if I assign the Control Source of the Toggle button as SignedOut the records are updated and we can see Visitor or staff in and out times. I guess this is incorrect way of doing this but it works. I could leave like this but what I would like to do is to have the Staff member go to the Sign Out form , pass their badge under the scanner and when their record appears for the form to update the record and close the form automatically. At the moment I am using Macros and wizards as I am a total non starter with VBA.
Any pointers or help is appreciated.
Apr 4 '12 #1
2 5495
Excuse my Error in the Paragraph under 'How it Works'
The correct method is A staff Member gets to the 'sign out form' then passes their ID Badge under Barcode Scanner, Field 1 (unbound)(attached is a Macro in 'before Update property' of field to Search for Record based on Badge ID No which is showing after scan) displays their Staff ID number and the Next Field FullName (bound to FullName control Source)and (Macro to requery) shows Staff Member name from Sign In record, not Badge ID as I posted.
Apr 4 '12 #2
Mihail
759 512MB
Too long explanation for my English.
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private Sub Button_Click()
  5. 'This will save the record if necessary (if the record has been modifyed
  6.     If Me.Dirty Then Me.Dirty = False
  7.  
  8. 'This force to save the record
  9.     DoCmd.RunCommand acCmdSaveRecord
  10.  
  11. 'This will close the form
  12.     DoCmd.Close acForm, "FormName"
  13. ''Or you can use
  14.     'DoCmd.Close acForm, Me.Name
  15. End Sub
Apr 5 '12 #3

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

Similar topics

3
by: Ptbrady | last post by:
"Order By" fails in form for linked table. -------------- My A2K database has worked well for several years, but now has been split into front-end/back-end and has the following problem. I have a...
0
by: EKL | last post by:
Hi, I'm making a sort of Customer and Orders database in MS Access 2003. My problem is that I wish to update the table "tblTransaction" based on changes made in the table "tblOrderDetails"....
4
by: James P. | last post by:
Hello there, I have a bound-form using Navigator so that the user can move back and forth to update record in the form. Every time a record was modified and the user clicks the Navigator to...
2
by: Tinius | last post by:
I am trying to update a field of type IMAGE. I am able to do this by deleting the record and then INSERTing a new record as shown below in the commented section. But I really want to do this...
4
by: Stan | last post by:
I am working with MS Office Access 2003 11.5614 on a computer running XP. If I change a property such as the input mask in a table, to have the change reflected in an existing form I have to go...
22
AccessIdiot
by: AccessIdiot | last post by:
Hello all, I have a form (frm_Entrainment) with a button that opens a 2nd form (frm_Specimen_Entrainment). The 2nd form shares an ID field with the first form (Entrainment_ID - its like opening...
1
by: mkheys | last post by:
Hi I have a database that I use for tracking ebay sales and profits. My sales table has a form that contains the ebay fees calculation but it won't update the sales table with the results from...
2
by: Hulas | last post by:
Guys, I have two questions. (a) How do I add two fields of the same table to a single combo box. For example if I have two fields ID1 and ID2 in a table called Identification, than how should I...
7
by: chrismaliszewski | last post by:
Hi. I created code which makes dynamically form with bounded controls for all columns. I show it to you below. My problem is, how I have to change this code to create form which record source...
0
by: Rod Faulk | last post by:
Hi! I have a problem almost exactly like this one: http://bytes.com/topic/access/answers/870079-updating-pivot-table-page-fields-based-another-page-field Nevermind.
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.