473,387 Members | 1,899 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.

Single event affecting multiple fields

Hello

I have downloaded an Access template from microsoft, and am trying to edit it a bit to give me exactly what I need.
(database = Desktop Time Card)

I have changed the field of 'Date Worked' to Date Time Entered, and added an extra 'Date Time Exited' field - I am trying to keep track of visitors into our complex so need to be able to sign them in and out.

I have added an event to the Entry time, dblClick will auto populate Now(). I've also added in the same dblClick of Now() to the Exit time. Unfortunately, when I dblClick the Entry it auto-populates both fields??

Expand|Select|Wrap|Line Numbers
  1. Private Sub Date_Time_Started_DblClick(Cancel As Integer)
  2. Me.Date_Time_Started = Now()
  3. End Sub
  4.  
  5. Private Sub Date_Time_Finished_DblClick(Cancel As Integer)
  6. Me.Date_Time_Finished = Now()
  7. End Sub
Any help is greatly appreciated...Thank you
May 20 '14 #1

✓ answered by jimatqsi

Look at the properties of the two text fields, Date_time_Started and Date_Time_Finished. Specificaly, look at the Data tab. What field name are these text boxes bound to? I'm thinking they are both bound to the same data item so when you change one you change them both.

They need to each one be bound to a different data item from the table they live in. Did you add a text box to the form without adding a new field to the table being edited?

Jim

2 1277
jimatqsi
1,271 Expert 1GB
Look at the properties of the two text fields, Date_time_Started and Date_Time_Finished. Specificaly, look at the Data tab. What field name are these text boxes bound to? I'm thinking they are both bound to the same data item so when you change one you change them both.

They need to each one be bound to a different data item from the table they live in. Did you add a text box to the form without adding a new field to the table being edited?

Jim
May 20 '14 #2
Hi Jim

Totally fixed...of course it was something very simple! That'll teach me to not use Access for 6 months and expect to still be competent!

Thank you very much
May 20 '14 #3

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

Similar topics

18
by: googleboy | last post by:
I didn't think this would be as difficult as it now seems to me. I am reading in a csv file that documents a bunch of different info on about 200 books, such as title, author, publisher, isbn,...
3
by: Ben Willcox | last post by:
Hi I am having difficulty writing an SQL query to do what I want: I have 1 table with 2 columns, 'id' and 'name': tbl_names: id name -- ---- 1 Bob 2 Jeff 3 Fred
2
by: CFW | last post by:
I use the following flawlessly to insert a single field: strSQL = "Insert into (Casket) Values " _ & "(" & conQuote & NewCasket & conQuote & ")" Set db = CurrentDb If MsgBox(NewCasket & " is...
4
4Him
by: 4Him | last post by:
First off, let me say this is a great site! I've just started working with Access and much of my success is from what I've read here! Background: I have a form, driven off a single table. Goal:...
1
by: Jason Northampton | last post by:
Hello This is the first time I've used a discusion forum and up until now I have managed to use and or modify VB code from the various sites on the web, until now! This is a simple problem and I...
2
by: Nathan Sokalski | last post by:
I have a Repeater that uses a DataSource that has multiple fields. When the values of these fields is displayed in the Repeater, there are fields that are used in combination with other fields as...
7
by: john.cole | last post by:
I have searched all the groups I can, and I still haven't been able to come up the solution I need. I have the following problem. In my form named sbfrmSpoolList, I am entering a job, spool and...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
27
by: mindbenderz | last post by:
I have a form (frm_docs_lookup_list) with 3 field controls: equip_sr, po_sr, vend_sr the form has a subform attached to : subfrm_docs_lookup_list the results in the subform display based on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.