UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Subform Dates Are Not Displayed Correct    
 
   
amy
post May 15 2018, 07:26 AM
Post#1



Posts: 9
Joined: 16-April 18



Hi,
I am creating Employee's weekly timesheet in MS Access by linking tables from SQL server.
I created main form with empployee table and subform with timesheet table.
When the employee wants to enter the timesheet they can enter the dates,worked hours and job code and department in the subform.
I am able to enter the values and its get saved in the SQL table at backend but the dates are not properly saved.When i enter the dates for the current day it enters the correct date but when i go to the next row to enter for the next day ,unfortunately it takes the same date what we entered previously.
But the values i entered in the subform is saved in SQL table in the backend.All the records are correct including the dates but in the sunform it is not showing correct.
I dont know where i am going wrong.Can anyone pls help me in this regard.
I have attached the screenshots of this.

Thanks.
Attached File  timelog.PNG ( 48.95K )Number of downloads: 5

Attached File  forms.PNG ( 22.84K )Number of downloads: 6

Attached File  sqltable.PNG ( 33.14K )Number of downloads: 5

Attached File  emptable.PNG ( 28.1K )Number of downloads: 5

Attached File(s)
Attached File  forms.PNG ( 22.84K )Number of downloads: 5
Attached File  forms.PNG ( 22.84K )Number of downloads: 5
 
Go to the top of the page
 
GroverParkGeorge
post May 15 2018, 07:52 AM
Post#2


UA Admin
Posts: 32,586
Joined: 20-June 02
From: Newcastle, WA


You've shown everything but the design views of the form and subform. That's where this problem will occur.


Also, how are the main form and subform linked in the Master/Child Linking Fields?


Thanks.

--------------------
Go to the top of the page
 
amy
post May 15 2018, 08:05 AM
Post#3



Posts: 9
Joined: 16-April 18



Master field and child fields are linked by Emp ID
Emp ID in employee table as Primary Key
Emp ID in Timelog table as Foreign Key
This post has been edited by amy: May 15 2018, 08:05 AM
Go to the top of the page
 
zaxbat
post May 15 2018, 08:43 AM
Post#4



Posts: 885
Joined: 26-January 06
From: .....the wiregrass (either you know or you don't)


Did you make this app yourself from scratch or did you inherit it. If you inherited it....could be that there is code to auto fill in the timecode data on the subform. I would like to see the data properties for the timesheetform...that might have useful info. And the event triggers for both the employee form and the timesheetform as well as the timesheetsubform.

But could be that the problem is all SQL/timing/requery related.....not sure.
This post has been edited by zaxbat: May 15 2018, 08:44 AM

--------------------
Kindest regards, and Cheers!
ZAX

A picture is worth a thousand words and a zipped DB is worth a thousand pictures.
Oh, and....please don't disappear into the Twilight Zone.... Holler back with your results!
Go to the top of the page
 
amy
post May 15 2018, 09:09 AM
Post#5



Posts: 9
Joined: 16-April 18



I have prepared it from the scratch.
Go to the top of the page
 
GroverParkGeorge
post May 15 2018, 09:11 AM
Post#6


UA Admin
Posts: 32,586
Joined: 20-June 02
From: Newcastle, WA


actually, re-reading the original post reveals a contradiction.

"... when i go to the next row to enter for the next day , unfortunately it takes the same date what we entered previously."

"But the values i entered in the subform is saved in SQL table in the backend. All the records are correct including the dates but in the [subform] it is not showing correct."

So either the subform does NOT "take the same date", or it does. And if it does store it correctly, then something else is going on here. Something we can't see from screenshots.

If you enter an employee's work items and close the form, then re-open the form to find that same employee and the same date, do the work dates and times now show up correctly?


I suspect that what you might be seeing is a default value for the time field. And that could be happening either at the table level (not likely) or within code in the subform.

Show us the complete picture, please.

--------------------
Go to the top of the page
 
amy
post May 15 2018, 11:09 AM
Post#7



Posts: 9
Joined: 16-April 18



I did reopen but it shows the same date for all the time i entered.
Go to the top of the page
 
GroverParkGeorge
post May 15 2018, 01:09 PM
Post#8


UA Admin
Posts: 32,586
Joined: 20-June 02
From: Newcastle, WA


Hm.

Okay, that's unusual.

Perhaps you can confirm that the subform is bound to the table and that each of the controls in the subform is bound to the appropriate field in that table.

--------------------
Go to the top of the page
 
zaxbat
post May 16 2018, 08:19 AM
Post#9



Posts: 885
Joined: 26-January 06
From: .....the wiregrass (either you know or you don't)


Amy do you know how to get a screen pic of the data properties for the form and subform? That would help to figure things out, maybe....unless the source is being set with VBA. A picture of the data table relationships might also show something useful. It just looks like you have some incorrect linkage. Only thing to do is look at all of your linkage and see what is amiss. If you don't have any sensitive data in there yet....maybe just zip it up and post it. And if you don't know how to do something, just ask....everybody has to start the same and none of us knew how to do any of this at first, either.
This post has been edited by zaxbat: May 16 2018, 08:23 AM

--------------------
Kindest regards, and Cheers!
ZAX

A picture is worth a thousand words and a zipped DB is worth a thousand pictures.
Oh, and....please don't disappear into the Twilight Zone.... Holler back with your results!
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    26th May 2018 - 07:03 AM