Hide autonumber when on empty

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

when i show a subform with records linked to a date relationship how do i
hide the empty record belows autonmber text field as it shows (auto nuber) at
the bttom of every subform in the empty record.

i require the empty record to be there so users can add to it and the auto
umber to work but i would like the auto number field to be invisible if empty
rather than showing.

i have tried if date = "" then ref.visible= false but to no avail

thanks again guys this site is aweome for help
 
On Fri, 16 Nov 2007 17:35:00 -0800, Rivers

The autonumber does not have to be on the subform at all. Take it out
and add some new records. Inspect the table. That's right: the
AutoNumber values are there.
If you must have the autonumber field on your form (I'm assuming it's
a datasheet), put it in the form header rather than in the Details
section.

-Tom.
 
when i show a subform with records linked to a date relationship how do i
hide the empty record belows autonmber text field as it shows (auto nuber) at
the bttom of every subform in the empty record.

I'd suggest not showing the autonumber AT ALL. The autonumber feature has one
purpose only: to provide a meaningless unique key. They're not intended for
human consumption; just keep them "under the hood", as they are generally not
useful outside Access.

John W. Vinson [MVP]
 
If you do want to show the autonumber, you could use conditional formatting
to suppress it at the new row.

1. Open the form in design view.
2. Select the text box that shows the AutoNumber.
3. Choose Conditional Formatting on the Format menu
(or on the Design tab of the ribbon in Access 2007.)

4. Set Condition 1 to:
Expression [ID] Is Null
replacing ID with the name of your autonumber field.
Then choose the White font, and okay the dialog.

The new row will then print in white on white, so it won't show.
 
Rivers said:
when i show a subform with records linked to a date relationship how
do i hide the empty record belows autonmber text field as it shows
(auto nuber) at the bttom of every subform in the empty record.

i require the empty record to be there so users can add to it and the
auto umber to work but i would like the auto number field to be
invisible if empty rather than showing.

i have tried if date = "" then ref.visible= false but to no avail

thanks again guys this site is aweome for help

Currently the ControlSource for your ref TextBox is the name of the field in
your table (I'll use "FieldName" as an example). Just change that to...

=FieldName

Once the control is based on an expression the "Auto Number" text will no longer
appear. This also makes a control non-editable, but since that is always true
for AutoNumbers it doesn't matter in this case.
 
Back
Top