Add/remove columns in datasheet by vba code

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
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.
 
Back
Top