Full Version: Not Displaying a Field if another Field is Empty
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
haygood
Is there a way to make a form not display a field if a another field is empty?

I'm using my AutoID for the Registration number for the Companies we register.
We already have numerous companies in the database, both registered and unregistered.
So, they all have "a registration number".
When someone looks up a certain company, the number and reg date are displayed on the Form.
I would like to fix it so if the date field is blank, the AutoID doesn't display.
dave1357
I think in the OnCurrent event of the form you could have something like (assuming you have your date field set up to take a date value or null):

If IsNull(Me.YourDateControlName) Then
Me.YourAutoIDControlName.Visible = False
Else
Me.YourAutoIDControlName.Visible = True
End If
haygood
Didn't.
My RegDate field is setup as a Date field.

If IsNull(Me.RegistrationDate) Then
Me.PCCID.Visible = False
Else
Me.PCCID.Visible = True
End If
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.