Feb 12 2007, 12:38 PM
I have a form that is attempting to populate 6 dates. There is an Enter Date, 1st Event Date, 2nd Event Date, 3rd Event Date, 4the Event Date, and Completed Date.
In an older version, these dates could populate the correct date when the information was updated. The current version, the 5 subsequent dates are all pulling the same date as the entered date.
The code looks like this:
RequesterName = Environ("UserNAME") & " " & Date
This populates the field with the person logged into the computer and the current date.
For the 1st event, the code looks like:
FirstOperation = Environ("UserNAME") & " " & Date
This populates the field with the person logged intot the computer and the current date, however, it pulls the first date from above. These events may not happen on the same day, so this is perplexing me as to why I cannot pull the current date when I need it.
Feb 12 2007, 12:56 PM
Welcome to Utter Access Forums! -o!
It sounds like the 6 date fields are FIELDS in a RECORD. If that is the case then your structure is not normalized. You should have your dates in a related table and they should be RECORDS in the table NOT FIELDS in a RECORD.
OperationDatesID (PK and auto)
OperationDescriptionID (FK to tblOperationDescriptions)
OperationDescriptionsID (PK and auto)
The above should be close to what you need if your structure is not normalized...
Feb 12 2007, 01:05 PM
You must have something else going on as the date function will always return the current date.
I would have seperated out the fields into two fields (UpdatedBy And UpdatedOn) and make Updated On a date variable. RequesterName and FirstOperation are not dates.
I would have used now instead of date to further seperate out the sequence of events by time and not just a day.
Feb 12 2007, 01:09 PM
These are Records in a table - sorry, my lingo may not be up to speed.
I have tried separating these and using together with the same results.
I have put a small sample database together that works perfect, but for some reason, I am pulling the first date in the form.
I do not understand what you mean by "normalized".
Sorry, I have enough experience to be dangerous.
Feb 12 2007, 01:23 PM
Can you post your db?
Feb 12 2007, 01:30 PM
Not quite sure what you want to see, just the VB or the whole thing?
I can copy and paste the VB, but how do you attach the whole thing?
Feb 12 2007, 01:48 PM
Attaching a DB zip it no larger than 500kb and no sensitive data and attach using the Browse button after clicking the Continue button to answer a post then click the browse button locate your file and double click it it should attach and fill the line to the left of the Browse button
Feb 12 2007, 01:50 PM
Run Compact and repair to min the db then zip it and attach it to your reply just after you hit the continue button and before submit.
Feb 12 2007, 03:33 PM
Wow, tons of posts in this forum today.
I have attached the database.
If you follow the "Yellow" colored text, you can see what I am having a problem with.
Thanks for looking,
Feb 12 2007, 03:44 PM
I am going to jump back in and ruin your day by telling you that your structure is not normalized. Table "LayoutRequestTable" has many 'repeating groups' and none of the other tables have primary keys of autonumber data type. I strongly suggest that you read this article
and then download this
file and go through the PowerPoint presentation along with the attached demo.
Better to spend the time normalizing your structure now rather than later....
My 3 cents worth...
Feb 12 2007, 03:54 PM
Found it. You have a field labelled Date next to RevLevel having control source =[Entered]
So you are assigning that value when you double clicked. Change the name of this field to say Date1 and the doubleclick will work OK.
I changed it to now() and saw correct PC date.
Feb 12 2007, 04:52 PM
I will work toward normalization, I did read the article, but felt that I wanted to get what I had posted before this got totally burried in the postings. I will work on normalization this evening.
Feb 12 2007, 05:01 PM
Good luck! By normalizing your data any existing forms may be of little value, but it is better to fix the db now rather than later... I think you have 3 or 4, maybe more, related tables. Without knowing your business model it is hard to know just how far down you need to break your tables...
Feb 12 2007, 09:43 PM
Warren, you are great. You have no idea how much time I spent banging my head over this.
Thank you very much.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here