Can it be done from VBA?

  • Thread starter Thread starter Patrick
  • Start date Start date
P

Patrick

HI!!
I would like to know if I can hide a few columns from a
certain table using VBA.
Example: in table1 I've got 3 columns.
clID IdName Description

Can I hide 'IdName' and 'clID' using VBA code.
The reason I'm asking is that depending on the user who
connects to my application, there aloud to export some on
the info in this table but not all of it. So I was
thinking of hiding the colums that the current user isn't
aloud to see and after, use the 'transferText' method onto
that table with the missing columns to execute my transfer
to a txt file.

Is that possible?

Thanks for any help you can provide-me with!
PAtrick
 
I suggest NOT letting your users interact directly with
your tables, but instead displaying tables through a form,
where you have much more control.

Assuming IDName and clID are placed in form controls named
txtIDName txtclID, respectively, the following code will
disable them and make them invisible:

txtIDName.Enabled = False
txtIDName.Visible = False
txtclID.Enabled = False
txtclID.Visible = False

Look in VBA Help (<Ctrl-G>, Help from database window)
under "User" if you need the syntax to identify the user.

HTH
Kevin Sprinkel
 

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

Back
Top