Solved Replicate Text Box in Continuous Form (1 Viewer)

alvingenius

IT Specialist
Local time
Today, 11:00
Joined
Jul 10, 2016
Messages
169
Hello Guys,

I have a simple problem I guess :unsure:

let's say I have a table with Names | TimeIn | TimeOut | WorkingHours Fields

i've a form with a query in Record source,
and I built a new field in a query to calculate the working hours with a name: Hours

and I have a calculated field in the query and I put it in form too

and i need it when i open the form. copies values from Hours Field to the Table text box in the same form WorkingHours

so in form i tried this VBA codes
in Current / In Load / In Active

SQL:
Me.WorkingHours = Me.Hours 'Getting Calculated Hours from Query and put it in Workinghours field in table '

this code works in single form, but in continuous form, i have to click on every record to replicate values on the whole records

So is there any way to replicate all values one time in continuous form?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:00
Joined
Oct 29, 2018
Messages
21,357
Hi. If you want to use a continuous form, you'll have to bind the textbox to a data source. Otherwise, using code on an unbound textbox will just display the same information on all rows.
 

alvingenius

IT Specialist
Local time
Today, 11:00
Joined
Jul 10, 2016
Messages
169
already using a date source from the query
and it shows what i want exactly in form

all i want to replicate values from this field to table field
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:00
Joined
Oct 29, 2018
Messages
21,357
already using a date source from the query
and it shows what i want exactly in form

all i want to replicate values from this field to table field
Hi. Can you post a screenshot to give us a better idea of what you mean?
 

alvingenius

IT Specialist
Local time
Today, 11:00
Joined
Jul 10, 2016
Messages
169
Hi
i've this Query as a record source of the form
Capture1.PNG
TimeDiff is the calculated field

and now with the form
Capture2.PNG


as u see in VBAi wanna copy the values from TimeDiff to ClockinLate in continues form

i tried to attach the sample DB but it's not allowed in attachment !!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:00
Joined
Oct 29, 2018
Messages
21,357
Hi. I can't see/download your attached query. Did you try to zip the db first?
 

alvingenius

IT Specialist
Local time
Today, 11:00
Joined
Jul 10, 2016
Messages
169
Sample zip attached

i wanna copy the values from TimeDiff to ClockinLate in continues form and saved in table
 

Attachments

  • Sample.zip
    50.9 KB · Views: 113

theDBguy

I’m here to help
Staff member
Local time
Today, 02:00
Joined
Oct 29, 2018
Messages
21,357
Sample zip attached

i wanna copy the values from TimeDiff to ClockinLate in continues form and saved in table
Hi. You know, there's really no need to "copy" the calculated value from TimeDiff to ClockinLate (because it's against Normalization Rules to store calculated values); but if you really want to do it, then you should be able to use an UPDATE query to do it. Agree?
 

zeroaccess

Active member
Local time
Today, 04:00
Joined
Jan 30, 2020
Messages
671
If you want to make them the same, why not just use the TimeDiff expression for the ClockinLate field?
 

alvingenius

IT Specialist
Local time
Today, 11:00
Joined
Jul 10, 2016
Messages
169
there's really no need to "copy" the calculated value from TimeDiff to ClockinLate (because it's against Normalization Rules to store calculated values)

So what to do in my case ? If what i need to do is against normalization rules ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:00
Joined
Oct 29, 2018
Messages
21,357
So what to do in my case ? If what i need to do is against normalization rules ?
Hi. I offered one approach earlier- use an UPDATE query.

But, why do you want to go against Normalization Rules?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 09:00
Joined
Jul 9, 2003
Messages
16,243
Db attached in zip already

I responded to your comment that you weren't allowed to make an attachment. Now you are saying you are allowed to make an attachment. I don't see the point of your latest comment? What am I missing?
 

alvingenius

IT Specialist
Local time
Today, 11:00
Joined
Jul 10, 2016
Messages
169
I responded to your comment that you weren't allowed to make an attachment. Now you are saying you are allowed to make an attachment. I don't see the point of your latest comment? What am I missing?

Hi
I forget to make this post as " Solved " and for not allowed to attach, i meant for a not zipped file ".ACCDB" but after zipped its attached and i uploaded it in this post

Thanks
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 09:00
Joined
Jul 9, 2003
Messages
16,243
, i meant for a not zipped file ".ACCDB" but after zipped its attached and i uploaded it in this post

It was me who told you to zip it...

>>>I think you are allowed to attach attachments if they are in zip file format<<<
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:00
Joined
Oct 29, 2018
Messages
21,357
I think that's a better solution
update query

thanks 🌷
Hi. Good luck with your project. Just be aware that by storing calculated values, you risk the integrity of your data. Cheers!
 

alvingenius

IT Specialist
Local time
Today, 11:00
Joined
Jul 10, 2016
Messages
169
Hi. Good luck with your project. Just be aware that by storing calculated values, you risk the integrity of your data. Cheers!

It's for Late Hours so i need to store this value

Thanks again
 

Users who are viewing this thread

Top Bottom