Primary Keys on Forms

A

adrian007uk

Is there anyway i can hide a primary key on a sub-form? The primary key is
an autonumber but is linked to the main form. If i try and make the primary
key invisible, Access will not let me proceed. If i delete the primary key
from the form, the form does not function correctly.

Adrian
 
J

John Spencer

You should be able to make the primary key control invisible. Are you doing
this in design view? You probably can't do it in other views since the
control would have the focus and I don't think you can set the visible
property to false if the control has the focus.

You could also do it in other views if you use VBA (say yusing the click event
of a button) to set the visible property.

Another choice would be to resize the control to 1 twip by 1 twip. That
effectively makes it invisible, but it can still get the focus. This is not a
good method.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
A

adrian007uk

I have made the primary key invisible but it still shows up on the form for
some reason.

Adrian
 
J

John W. Vinson

Is there anyway i can hide a primary key on a sub-form? The primary key is
an autonumber but is linked to the main form. If i try and make the primary
key invisible, Access will not let me proceed. If i delete the primary key
from the form, the form does not function correctly.

Adrian

Is this a Datasheet subform? You could use a Continuous form instead and just
not include a textbox for the primary key field. If it is a datasheet form,
you can either shrink that column to zero width, or base the subform on a
Query; uncheck the "Show" checkbox on the field or fields you want to conceal.

I've never seen an error "will not let me proceed" or "does not function
correctly" - could you explain?
 
A

adrian007uk

John

Sorry i confused myself. I was able to hide the primary key but the
sub-sub-form needs it to function correctly which is why i am trying to make
it invisible.

Adrian
 
A

adrian007uk

It also says "you can't view a form as a continuous form if it contains a
subform, an activeX control, or a bound chart".

Adrian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top