Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access Visual basic Statement in statement How To

Posted on 2013-01-29
4
Medium Priority
?
420 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Flyster
ID: 38832665
Did you try it without the &'s?

S2 = "[Me.Select1]"

Flyster
0
 
LVL 48

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 38832672
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
ID: 38832753
This worked like a charm, all assumptions made were correct.
0
 
LVL 48

Expert Comment

by:Dale Fye
ID: 38832799
glad I could help.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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 …

618 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