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

How do i get a user input to repeat into each new record?

I want user to enter a date on a form and have that date repeat for each record on table column and new records on form.

Is this possible?
Aug 13 '19 #1

✓ answered by twinnyfo

You should have an Employees Table with a primary Key. That table should have a field in it called HireDate, as well as all the other employee-specific data that would occur only once (FirstName, LastName, EmployeeIDNumber, etc.). Any other tables related to the Employees should only need to use the Primary Key of the Employees table to refer back to that record. This is the basic construction of all Relational database.

Sounds like you have more significant issues than the one posted.

15 1323
twinnyfo
3,653 Expert Mod 2GB
Lswworth,

Welcome to Bytes!

That should be fairly simple. In the Form's OnCurrent Event:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.     If Me.NewRecord Then _
  3.         Me.txtFieldName = Me.txtUserEnteredDate
  4. End Sub
Hope this hepps!
Aug 13 '19 #2
When I click on the text field on current is not listed on the property sheet.
Aug 13 '19 #3
twinnyfo
3,653 Expert Mod 2GB
This is a property of the Form--not the control.
Aug 13 '19 #4
Got it.

I'm getting an error for me.txtuserenteredate

method or data member not found.
Aug 13 '19 #5
twinnyfo
3,653 Expert Mod 2GB
Obviously, you must rework the code so that the names of the controls match your form.
Aug 13 '19 #6
No errors but new record is blank.
I need a user entered date box that will keep the date entered for new records without additional input.
Aug 13 '19 #7
twinnyfo
3,653 Expert Mod 2GB
Ok. Perhaps I wrongly presumed that you had more experience with Access.

On your form create two text boxes. The first text box is UNBOUND to the underlying table. This is the text box that users will enter the date. You should make sure that this control only accepts a true date when data is entered otherwise you will have additional problems.

The second text box is BOUND to the underlying table and the field you want updated. Then, whenever a user enters a date, moving to a new record will update that field with the date entered by the user. There will need to be additional tweaks and perhaps adding an AfterUpdate event to the text box so that entering the date will update the current record (if you wish).

This is the basic idea.

Hope that makes more sense.
Aug 13 '19 #8
Yeah, I've been teaching myself. I've got a few spreadsheets to work like I want. Sometimes I impress myself, but this one is giving me hell. At work right now. I'll try again tonight or tomorrow.
Aug 13 '19 #9
twinnyfo
3,653 Expert Mod 2GB
Let us know what kind of guidance you need and we'll see what we can do....
Aug 13 '19 #10
Okay, I finally got it working, but only for new records.
This is good, but I would also like it if when someone changes the unbound text date then dates in all records be updated to new date.

For instance, if a senior employee shares form with new employee and new employee changes hire date... this date would reflect in all their records.

Thank you again for your help.
Aug 16 '19 #11
twinnyfo
3,653 Expert Mod 2GB
Your explanation now clarifies that your structure is incorrect. An Employee can only have one hire date. This hire date should not be on multiple records, but only one the ONE record pertaining to Employee Data. This date should not be on all records associated with this employee. Rather, the table with Employee data should be related to other tables that refer to employees.
Aug 16 '19 #12
Initially, I did have two tables but couldn't figure out how to link both tables.
Aug 16 '19 #13
twinnyfo
3,653 Expert Mod 2GB
You should have an Employees Table with a primary Key. That table should have a field in it called HireDate, as well as all the other employee-specific data that would occur only once (FirstName, LastName, EmployeeIDNumber, etc.). Any other tables related to the Employees should only need to use the Primary Key of the Employees table to refer back to that record. This is the basic construction of all Relational database.

Sounds like you have more significant issues than the one posted.
Aug 16 '19 #14
NeoPa
32,556 Expert Mod 16PB
Hi.

It looks like Twinny has given you the answer your problem really needs so I've set that as the Best Answer.

Should you need more assistance, and that's perfectly fine if you do, please post new questions in separate threads.

Bear in mind you should be looking to post your questions to ask the for the fundamental information rather than getting half way with an idea then asking for help with that. Often the reason you can't make such ideas work is that they are ideas that can't work.

Go for the fundamental question and we can help you with the right approach and, generally that way, everything's just easier.

We do understand that it's sometimes difficult to determine what is fundamental when your working in a new area so just aim for that and we'll give you the best advice we can.
Aug 18 '19 #15
Yes, that is the best answer.
Sorry, I have several projects I'm working on around the house. I had to take a break from this "work" project for a little bit. It's really only for brownie points, so no rush.

I did relate the tables by ID and made a query including both tables. Then I created a form based on that query. It looks like it might work. I have to go to work, but maybe if I have time I'll play with it tomorrow.

Thank you for all your help.
Aug 20 '19 #16

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

Similar topics

2
by: Renie83 | last post by:
Hi I really am going crazy! I'm using VBScript, ASP, and SQL My page reminds me of a shopping cart but looking at shopping cart examples has not helped! What I have is a page that brings in...
0
by: Ray Lavelle | last post by:
I'm new to VB .NET. In the past when creating an application, if I had an input form I would just call the set and get methods on the object that mapped to my database table in order to store and...
4
by: Joe User | last post by:
Hi all....I have a feeling this is going to be one of those twisted query questions, but here it goes anyways.... I want to generate a report that shows the chronology of events (represented by...
3
by: Clare | last post by:
Hi I have a report that is made of 4 subreports. There is no actual information in the main report, and the record source is empty. In the Header section of the main report, I have a text box...
6
by: Robin S. | last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope I've done a better job of explaining myself below. I am trying to produce a form to add products to a table (new...
20
by: Greg | last post by:
I'm fairly new to access (using 2002) and am setting up a DB for work. along with each record the user also needs to make a flow diagram (previously, these reports were composed in word and they...
2
by: josephm | last post by:
Hello Group: My first post on the group.Hope I get a response. I have a modest Fire Insurance ACCES Db.Thanks to this group - for the code. A "wanna be programmer"... "LEARNS" The code...
0
by: Marcelo | last post by:
Hi, I have the following need: I list a table from an access database but cannot interact with each record. At the html page I display all records, one field (field1) from and 3 buttons for each...
2
by: Matt | last post by:
Hi, I'm ridiculously new to Access (about a week!) so please be patient! My database is a record of British Standards. Each has a unique identifier. Some are split into parts. I would like...
3
by: bluez | last post by:
I want to design a webpage where user can search the data from the database and list out the related records. Each of the record got a delete button which allow user to delete the record. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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...

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.