Gustav Brock
gustav at cactus.dk
Tue Dec 2 12:15:52 CST 2003
Hi Charlotte and Oleg Or: If IsNull(Me!txtFrom.Value) Or IsNull(Me!txtThrough.Value) Then /gustav > In Access you can only refer to the Text property of a control when that > control has the focus. Just take the Text property out of your code and > it will work in Access. > Charlotte Foust > -----Original Message----- > From: Oleg_123 at xuppa.com [mailto:Oleg_123 at xuppa.com] > Sent: Tuesday, December 02, 2003 8:52 AM > To: accessd at databaseadvisors.com > Subject: [AccessD] no Focus > This would have forked in VB6, but in Access I am getting "no focus > error" what should i do ? > Private Sub sndBrian_Click() > Dim From As String > Dim Through As String > Dim dtEdate > dtEdate = Format(Now() - 3, "mm-dd") > If txtFrom.Text = Null Or txtThrough.Text = Null Then > txtFrom.Visible = True > txtThrough.Visible = True > MsgBox "Please enter FROM and THROUGH dates in mm-dd format", , > "dates" Exit Sub End If