473,325 Members | 2,442 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,325 software developers and data experts.

duplicate date in another field

Hi!! In my table, I have two fields that will be filled with the same date (but I need both fields). So that the person entering the data doesn't need to enter the same date twice, I've been trying to fiddle with the form so that the second field (which will not be on the form) will be automatically filled in with the date entered into the first field.

I don't really use code (am newbie... willing to learn) but this is what I've done. In the properties box, I've tried under AfterUpdate, AfterEnter, AfterExit (as many different things as I could try) to enter
[variable 1]=[variable 2].

Then, I actually went to "view code" and entered into the big box
Private Sub textbox1_AfterUpdate()
Me!textbox2 = Me!textbox1
End Sub

I'm sure that this is really easy. If anyone has any tips, please let me know. If it involves writing the code, please tell me where to put the code. Thanks!! I appreciate your patience with what I'm sure is an easy question.

Kathleen
Apr 12 '07 #1
8 1611
PS: I'm using Access 2000.
Apr 12 '07 #2
Rabbit
12,516 Expert Mod 8TB
Hi!! In my table, I have two fields that will be filled with the same date (but I need both fields). So that the person entering the data doesn't need to enter the same date twice, I've been trying to fiddle with the form so that the second field (which will not be on the form) will be automatically filled in with the date entered into the first field.

I don't really use code (am newbie... willing to learn) but this is what I've done. In the properties box, I've tried under AfterUpdate, AfterEnter, AfterExit (as many different things as I could try) to enter
[variable 1]=[variable 2].

Then, I actually went to "view code" and entered into the big box
Private Sub textbox1_AfterUpdate()
Me!textbox2 = Me!textbox1
End Sub

I'm sure that this is really easy. If anyone has any tips, please let me know. If it involves writing the code, please tell me where to put the code. Thanks!! I appreciate your patience with what I'm sure is an easy question.

Kathleen
Why would you need two fields that are the same thing?

But other than that, your code looks fine, is it not working?
Apr 12 '07 #3
It's kind of stupid - I am entering data into an uploadable data set that was created by someone else. It has two different dates, but we aren't tracking one of the dates. Unfortunately, the date that we don't track is required. So we're going to enter the same date into both fields.

The code isn't working, which makes me think that I'm entering the code into the wrong place. And by not working, I mean that when I enter a date into the first field and click out of the field, the date does not show up in the second field.

Any insight would be MUCH appreciated.
Apr 12 '07 #4
Rabbit
12,516 Expert Mod 8TB
You can't just delete that field or leave it blank?
Apr 12 '07 #5
Rabbit
12,516 Expert Mod 8TB
If you named everything correctly then the code should work just fine.
Apr 12 '07 #6
First, THANK YOU for your feedback. This is what I'm doing:

I toggled over to the code portion, then selected variable one (called eirfdate: month) from the pull-down menu and AfterUpdate from the other pull down menu. Then I entered the rest of the code so that the whole thing looks like this:

Private Sub eirfdate__month_AfterUpdate()
Me!eirf7m = Me!eirfdate: Month
End Sub

When I went back to the form to try it, this is the error that I got:
Compile error: argument not optional

Any ideas?
Apr 12 '07 #7
missinglinq
3,532 Expert 2GB
Hey, Kathleen!

The problem I see is that you have a control name with a space and a colon in it, both of which are reserved in Access! Try putting brackets around it:

Me!eirf7m = Me![eirfdate: Month]
Apr 12 '07 #8
Whooo-hoooo!!!! What a difference that little bracket made!! Thank you, everyone, for your help.
Apr 12 '07 #9

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

Similar topics

3
by: Giloosh | last post by:
Hello, i need some help if possible... i have a payments table with over 500 records i want to run a query that searches through the table spotting out any duplicate ID#'s and Dates. So basically...
2
by: Ross | last post by:
i have less hair now than i used to...i have a database with many duplicate records in it with only one exception, there is one field with the date it was put in the database and that is different....
2
by: lewie | last post by:
I am trying to construct a semi duplicate query. I want it to match 2 fields and check a range for the 3rd match as follows date = date, title = title, and start time between start time and end...
8
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on...
8
by: sixdeuce62 | last post by:
Hello, I am using Access 2002. I have read through 20 plus posts on here and I am still having trouble. My table consists of the following fields: Date Client ID
4
by: mcca0081 | last post by:
hi - i'm trying to delete one of the duplicate records based on the most current date. here's the code for my access 2000 db. any help would be appreciated!!! - thank you kindly Sub...
1
by: gelpaks | last post by:
My problem is a bit long and involved, but I will try to summarize. I have created a database using Access 2000 for a cemetery and it now is populated with almost 6,000 names. I created a form so...
7
by: jmstur2 | last post by:
I have a table with what I consider duplicate records. Data in all columns are duplicate except for the date column, meaning that duplicate data was entered on different dates and those dates were...
4
by: ramdil | last post by:
Hi All I have table and it have around 90000 records.Its primary key is autonumber field and it has also have date column and name, then some other columns Now i have problem with the table,as my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.