Solved Text Box Default Value

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

One note you should look into Normalising your tables as there is a lot wrong with just the 2 tables.
 
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

here is your db
add equipid to your subform
 

Attachments

Last edited:
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
 
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\#")
 
Which machine?
1613640415608.png
 
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 ?
 
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 ?
 
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.
 
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

Back
Top Bottom