20. december 2004 - 17:03Der er
5 kommentarer og 1 løsning
Date validation rule. Not more than 1 month bigger than value in
Date validation rule. Not more than 1 month bigger than the value in a query which only contains this date. A query called q-lastbookeddate contains the last date where depriciations were run (usually the last date of previous month). In a form there is a date field which the user enters. I would like to validate that the user does not enter a date bigger than 1 month ahead of the date in q-lastbookeddate. TIA
Private Sub Form_BeforeUpdate(Cancel As Integer) If Me.LastBookedDate > DateAdd("m", 1, DFirst("LastBookedDate", "tblSystem")) Then MsgBox "Date wrong" Cancel = True End If
q-lastbookeddate is not linked or a part of the private sub form, is that the problem I have in this line (It does not understand Me.LastBookedDate) If Me.LastBookedDate > DateAdd("m", 1, DFirst("LastBookedDate", "tblSystem")) Then...
Secondly I have the feeling that vba does not "like" -(score, I think it is called), which might be a problem due to the fact that my query and table names all uses eg. t-reg, q-lastbookeddate..? TIA
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.