Solved Text Box Default Value (1 Viewer)

Dreamweaver

Well-known member
Local time
Today, 05:48
Joined
Nov 28, 2005
Messages
2,466
I have used a combo but you could update the last date(s) OnCurrent
I have added a date to the main form as that is where I might put it if I was doing this.
plus a date has been added to the subform footer which gets it's default value from the main forms combo.
Open form frmLastServicedate
One other note I have used the subforms OrderBy to set the servicedate as the order by field.
Hope it helps
mick
 

Attachments

  • Help.zip
    99.2 KB · Views: 94

Dreamweaver

Well-known member
Local time
Today, 05:48
Joined
Nov 28, 2005
Messages
2,466
One note you should look into Normalising your tables as there is a lot wrong with just the 2 tables.
 

Emma35

Registered User.
Local time
Yesterday, 21:48
Joined
Sep 18, 2012
Messages
467
Hi guys....here's the file. It looks terrible but pay no attention to that. If it turns out i've been doing something silly i apologise in advance :rolleyes:
 

Attachments

  • ServiceRecs.zip
    712.9 KB · Views: 74

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:48
Joined
May 7, 2009
Messages
19,246
here is your db
add equipid to your subform
 

Attachments

  • ServiceRecs.zip
    440.6 KB · Views: 101
Last edited:

Emma35

Registered User.
Local time
Yesterday, 21:48
Joined
Sep 18, 2012
Messages
467
Thanks arnelgp and MickJav for taking the time to help. It's working fine now.
Thank you also to everyone who helped along the way....i'd never get any of these projects finished without you guys.

Emma xx
 

Emma35

Registered User.
Local time
Yesterday, 21:48
Joined
Sep 18, 2012
Messages
467
Hi again lads.....sorry for bumping this thread. If it's not allowed then i apologise and i'll start a new one.
Everything was working fine until the change of the year.........the txt box which shows the last time the machine was serviced is showing a December date from 2020 even though there are new entries for 2021 ?.
The current code i have in the OnCurrent event of the subform is

Code:
Me.txtLast.DefaultValue = Format(Nz(DMax("CalibrationDone", "tbl_CalibrationRecords", "EquipID = '" & Me!EquipID & "'"), Date), "\#dd\/mm\/yyyy\#")
 

Gasman

Enthusiastic Amateur
Local time
Today, 05:48
Joined
Sep 21, 2011
Messages
14,433
Which machine?
1613640415608.png
 

Emma35

Registered User.
Local time
Yesterday, 21:48
Joined
Sep 18, 2012
Messages
467
That's the odd thing Gasman....some records are ok but others don't seem to be recognising the fact that there are new entries for 2021 ?
I would have thought that the code would govern all records......so if it wasn't working on one then it wouldn't work on any ?
 

Gasman

Enthusiastic Amateur
Local time
Today, 05:48
Joined
Sep 21, 2011
Messages
14,433
Well you would need to supply the correct DB?
I used arnel's and that only has 3 records? A001 has two, one for 2020 and one for 2021 ?
 

Gasman

Enthusiastic Amateur
Local time
Today, 05:48
Joined
Sep 21, 2011
Messages
14,433
That's the odd thing Gasman....some records are ok but others don't seem to be recognising the fact that there are new entries for 2021 ?
I would have thought that the code would govern all records......so if it wasn't working on one then it wouldn't work on any ?
It will, unless some other factor is involved.
 

Emma35

Registered User.
Local time
Yesterday, 21:48
Joined
Sep 18, 2012
Messages
467
Thanks Gasman you put me on the right track when you said 'other factor'. I went through everything and discovered that a colleague renamed the unbound text box when he was making a couple of changes while i was away. So i changed it back, rang him and told him he was an idiot, and everything's fine again.
Thanks
Em x
 

Users who are viewing this thread

Top Bottom