• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 422
  • Last Modified:

Access Visual basic Statement in statement How To

Microsoft Access Visual Basic 2007

I have this:

S2 = "[" & Me.Select1 & "]"
 
Forms!main.Form!Data.S2.ColumnHidden = False


Notice, i'm trying to use the S2 in the second statement.

But this won't work, can someone please provide a suggestion about how to go about this?
0
Ursino
Asked:
Ursino
  • 2
1 Solution
 
FlysterCommented:
Did you try it without the &'s?

S2 = "[Me.Select1]"

Flyster
0
 
Dale FyeCommented:
Try something like:

Forms!Main!subformControlName.Form.Controls(me.Select1).ColumnHidden = False

I assume you are trying to unhide a column in a datasheet that is being used as a subform on you main form.  Where is this code firing from?  Is it a control on the main form?  If so, you should be able to use something like:

me.subformControlName.Form.Controls(me.Select1).ColumnHidden = false

Note:  subformControlName refers to the NAME of the subform CONTROL, not the name of the form that is the SourceObject of the subform.
0
 
UrsinoAuthor Commented:
This worked like a charm, all assumptions made were correct.
0
 
Dale FyeCommented:
glad I could help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now