saledo2000
Registered User.
- Local time
- Today, 23:18
- Joined
- Jan 21, 2013
- Messages
- 94
Hi experts,
I have table tblReg and form frmReg. On that form have an unbound text box (txtAge) for Age where I put expression ***=DateDiff("yyyy", [DoB], Date())*** to count how old is every person in Reg table. Field DoB is bounded to text box txtDoB on the same form. It is working perfectly, since I do not want to update Age after some years. Is there any VBA solution to insert Age value in the tblReg table (field Age) to use it for statistical queries such is age range. I would like to have this INSERT INTO statement for the current record on the Exit button on frmReg form. Until now I wrote a code like:
***currentdb.Execute "INSERT INTO tblReg(Age) VALUES ('" & Me.txtAge & "')" ***
But it does not insert Age in tblReg table.
Could you please help on this matter because I am a new in access world.
Thank you very much.
I have table tblReg and form frmReg. On that form have an unbound text box (txtAge) for Age where I put expression ***=DateDiff("yyyy", [DoB], Date())*** to count how old is every person in Reg table. Field DoB is bounded to text box txtDoB on the same form. It is working perfectly, since I do not want to update Age after some years. Is there any VBA solution to insert Age value in the tblReg table (field Age) to use it for statistical queries such is age range. I would like to have this INSERT INTO statement for the current record on the Exit button on frmReg form. Until now I wrote a code like:
***currentdb.Execute "INSERT INTO tblReg(Age) VALUES ('" & Me.txtAge & "')" ***
But it does not insert Age in tblReg table.
Could you please help on this matter because I am a new in access world.
Thank you very much.
Last edited: