T
Tom
I need some help w/ modifying the function (below ***s). More specifically,
I need to
make adjustments to the line the begins w/ "CurrentDb.QueryDefs".
Right now, when I click on textbox A1Q1, the control name "A1Q1" is being
read into the
"CurrentDb.QueryDefs" (& ctl.Name &).
However, instead of "A1Q1", I want the following being read into the
"ctl.Name":
- Strip "A1" from "A1Q1"
- Add "Score" in front of "Q1"
.... essentially, I want to replace the control name "A1Q1" with "ScoreQ1"
without actually changing the control name in the textbox. "Score" wil be
static...
while "Q#" can be x.
Is that possible? If yes, how would I go about it?
******************************
Private Sub A1Q1_Click()
Dim ctl As Control
Set ctl = Screen.ActiveControl
CurrentDb.QueryDefs("Query1").SQL = "Select " & ctl.Name & "
From tblTest;"
DoCmd.OpenQuery "Query1"
Set ctl = Nothing
End Sub
******************************
Thanks so much in advance,
Tom
I need to
make adjustments to the line the begins w/ "CurrentDb.QueryDefs".
Right now, when I click on textbox A1Q1, the control name "A1Q1" is being
read into the
"CurrentDb.QueryDefs" (& ctl.Name &).
However, instead of "A1Q1", I want the following being read into the
"ctl.Name":
- Strip "A1" from "A1Q1"
- Add "Score" in front of "Q1"
.... essentially, I want to replace the control name "A1Q1" with "ScoreQ1"
without actually changing the control name in the textbox. "Score" wil be
static...
while "Q#" can be x.
Is that possible? If yes, how would I go about it?
******************************
Private Sub A1Q1_Click()
Dim ctl As Control
Set ctl = Screen.ActiveControl
CurrentDb.QueryDefs("Query1").SQL = "Select " & ctl.Name & "
From tblTest;"
DoCmd.OpenQuery "Query1"
Set ctl = Nothing
End Sub
******************************
Thanks so much in advance,
Tom