Hi
question 1 : do you ever finish a database? ;-)
Question 2:
I have a text field named "txtYearOfBaptism" which I use to create a temporary variable based on the year typed in by the user.
I was using the database and trying to break it when I realised that if in error I input fred instead of 1829 the database did horrible things so decided it need a validation rule.
So I went to field properties validation rule expecting to be able to create some vba code/ or a macro to display a message box - This field requires a numerical value ie 1878
However the validation option only seems to bring up the expression builder which I have no experience of.
I then realized that as I was using a button to create my temporary variable I could possibly add some vba here.
But as I'm not at all sure which way to go thought I'd ask!
Button code below
thanks
Ian
Code:
Private Sub btn_Search_baptismyear_Click()
TempVars!varBaptismYear = Me.txtYearOfBaptism.Value
If DCount("*", "qry_BaptismsYearSearch") > 0 Then
DoCmd.Close
DoCmd.OpenForm "frm_BaptismYearSearchResults", acNormal, "", "", , acNormal
Else: MsgBox "There are no Baptism Records containing this Year"
TempVars.Remove "varBaptismYear"
End If
End Sub