Solved

Access Visual basic Statement in statement How To

Posted on 2013-01-29
4
364 Views
Last Modified: 2013-01-29
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
Comment
Question by:Ursino
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Flyster
Comment Utility
Did you try it without the &'s?

S2 = "[Me.Select1]"

Flyster
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
Comment Utility
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
 

Author Closing Comment

by:Ursino
Comment Utility
This worked like a charm, all assumptions made were correct.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
glad I could help.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now