Add/remove columns in datasheet by vba code

G

Guest

I have an Access project (ADP file) used as front end communicating with an SQL Server 2000 database. One query (stored procedure on SQL Server 2000) returns a variable number of columns to the Access client. The columns are displayed in a datasheet subform. Is there a way I can use visual basic to add/remove columns in the datasheet? I would prefer to do this in the ON OPEN event of the form

The Access application is notified of number of columns and their labels by return parameters from the stored procedure. Everything works fine, but I cannot figure out a practical way to remove/insert columns

Regard

Tore
 
Y

Yuan Shao

Hi Tore,

Thanks for your post. According to your description, I am not quite clear
your problem in detail. Do you mean that you want to change the number of
the columns in a datasheet view of a subform? Can you simply change the
number of the columns via resetting the record source of the subform using
VBA? Does it meet your requirements? If not, please feel free to let me
know the root concerns of your requirements.

Thanks for posting in community.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
C

clown

Yuan said:
Hi Tore,

Thanks for your post. According to your description, I am not quite clear
your problem in detail. Do you mean that you want to change the number of
the columns in a datasheet view of a subform? Can you simply change the
number of the columns via resetting the record source of the subform using
VBA? Does it meet your requirements? If not, please feel free to let me
know the root concerns of your requirements.

Thanks for posting in community.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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