| re: Prevent data entry of Date Field
Randy wrote:
[color=blue]
> I want to set up a table where I can enter dates that will prevent data
> entry of Dates in the Main table.
>
> I have done this in Approach by linking two tables and setting up a
> validation formula IsBlank (Date.Date). After staff enter dates in the
> detail table it will prevent dates in the Main table.
>
> How can I do that in Access?
>[/color]
In the AfterUpdate event of the subform (I'll assume subform) then enter
something like
If Not IsNull(Me.DateField) then
Forms!MainForm!MainDateField = Null
Forms!MainForm!MainDateField.Enabled = False
Endif
In the OnCurrent event of the main form you could enter something like
Dim rst As REcordset
set rst = Forms!MainForm!SubForm.Form.Recordsetclone
rst.findfirst "DateField Is Not Null"
Me.MainDateField.Enabled = (Not rst.NoMatch)
set rst = Nothing |