me. string variable issue

  • Thread starter James Gaylord via AccessMonster.com
  • Start date
J

James Gaylord via AccessMonster.com

I have a for next loop that I thought should work. Basically am setting
certain fields to visible based on a number from a combo box on another form.
What I can't figure out is how to set it up so that I can use the string I
create as part of the me. .visible command.

Here is my code:

Private Sub Form_Open(Cancel As Integer)
Dim stTableNum, stType As String
Dim stNumFields As String

intNumFields = Split(Me.OpenArgs, ";")(0)
For i = 1 To intNumFields
stTableNum = "Table Segment Value " & i

Me.[stTableNum].Visible = True

Next i

stType = Split(Me.OpenArgs, ";")(1)

If stType = "C" Then
Me.Rules_Table_Value.Visible = True
ElseIf stType = "Q" Then
Me.Unit_of_Measure.Visible = True
Me.Item_Number__Short_.Visible = True
Me.Quantity_Per.Visible = True
Else
Me.Entered_Unit_Price.Visible = True
End If

stName = Split(Me.OpenArgs, ";")(2)

Me.Rules_Table_Name = stName

End Sub

I tried me.stTableNum.visible and what you see above to no avail. First, is
it possible to do somehting like this and if so how.

TIA

--
James B Gaylord
From the Wolf Comes the Strength of the Pack
From the Pack Comes the Strength of the Wolf
- R Kipling

Message posted via AccessMonster.com
 
J

James Gaylord via AccessMonster.com

So how do I get its assoctiated label to be visible?
Me.Controls(stTableNum).Visible = True
I have a for next loop that I thought should work. Basically am setting
certain fields to visible based on a number from a combo box on another
[quoted text clipped - 39 lines]

--
James B Gaylord
From the Wolf Comes the Strength of the Pack
From the Pack Comes the Strength of the Wolf
- R Kipling

Message posted via AccessMonster.com
 
J

James Gaylord via AccessMonster.com

Never mind I figured it out. it was just substituting the label name for the
control itself.

Thanks anyway

James said:
So how do I get its assoctiated label to be visible?
Me.Controls(stTableNum).Visible = True
[quoted text clipped - 3 lines]

--
James B Gaylord
From the Wolf Comes the Strength of the Pack
From the Pack Comes the Strength of the Wolf
- R Kipling

Message posted via AccessMonster.com
 
J

James Gaylord via AccessMonster.com

Never mind I figured it out. it was just substituting the label name for the
control itself.

Thanks anyway

James said:
So how do I get its assoctiated label to be visible?
Me.Controls(stTableNum).Visible = True
[quoted text clipped - 3 lines]
 

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