D
Don
I am debugging some code that someone else wrote and have run into what I
think is a scoping problem. The original writer of the code has a combo box
on a form. Using the properties sheet, he defined:
Row Source Type = Table/Query
Row Source = SELECT qryTestCodes.TestCode, qryTestCodes.TestDes,
qryTestCodes.TestCodeOorE, qryTestCodes.TestCodeId, Right('xxxx' &
[DivPassCode],4) AS DivPass, Left([testcodeOorE],1) AS OE,
qryTestCodes.DivLocation FROM qryTestCodes WHERE
(((Left([testcodeOorE],1))=[sOECode])) ORDER BY Right("00000000000" &
Trim([TestCode]),11);
[TestCode] is in a recordset the form has open and I am assuming
[testcodeOorE] is referring to qryTestCodes.TestCodeOorE. The problem is
with [sOECode]. When a Requery is done on the combo box
(cboProblemComb.requery), a "Enter Parameter Value" combo box pops up asking
for a value of sOECode.
sOECode is declared as follows in the VB module for the form:
Public sOECode As String
So, my guess is that the variable sOECode is not visible to the query in the
Row Source. If this assumption is correct, is there a way to make the
variable 'more globally' visible? If the assumption is incorrect, is there
a way around this problem?
Thanks!
Don
think is a scoping problem. The original writer of the code has a combo box
on a form. Using the properties sheet, he defined:
Row Source Type = Table/Query
Row Source = SELECT qryTestCodes.TestCode, qryTestCodes.TestDes,
qryTestCodes.TestCodeOorE, qryTestCodes.TestCodeId, Right('xxxx' &
[DivPassCode],4) AS DivPass, Left([testcodeOorE],1) AS OE,
qryTestCodes.DivLocation FROM qryTestCodes WHERE
(((Left([testcodeOorE],1))=[sOECode])) ORDER BY Right("00000000000" &
Trim([TestCode]),11);
[TestCode] is in a recordset the form has open and I am assuming
[testcodeOorE] is referring to qryTestCodes.TestCodeOorE. The problem is
with [sOECode]. When a Requery is done on the combo box
(cboProblemComb.requery), a "Enter Parameter Value" combo box pops up asking
for a value of sOECode.
sOECode is declared as follows in the VB module for the form:
Public sOECode As String
So, my guess is that the variable sOECode is not visible to the query in the
Row Source. If this assumption is correct, is there a way to make the
variable 'more globally' visible? If the assumption is incorrect, is there
a way around this problem?
Thanks!
Don