Full Version: Multiple Dates
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
gbelnap
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.

Any thoughts?

Thanks,

Glen
Jack Cowley
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.

tblOperationDates
OperationDatesID (PK and auto)
PrimaryKeyIDOfRelatedTable (FK)
OperationDescriptionID (FK to tblOperationDescriptions)
OperationDate

tblOperationDescriptions
OperationDescriptionsID (PK and auto)
OperationDescription

The above should be close to what you need if your structure is not normalized...

hth,
Jack
wmburgess
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.

Cheers.
gbelnap
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.

Glen
wmburgess
Can you post your db?

Cheers.
gbelnap
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?

Glen
jmcwk
Normalizing Here 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
wmburgess
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.

Cheers.
gbelnap
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,

Glen
Jack Cowley
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...

Jack
wmburgess
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.

Cheers.
gbelnap
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.

Glen
Jack Cowley
Glen -

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...

Jack
gbelnap
Wow.

Warren, you are great. You have no idea how much time I spent banging my head over this.

Thank you very much.

Regards,

Glen
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.