0
을 사용하여 TempVar
문자열 값을 평가하려고하지만 정확한 결과를 제공하지 않습니다. 지금까지선택 케이스의 온도 막대
내 VBA 코드 :
Private Sub Form_Load()
Select Case TempVars!CurrentStatus
Case Entered
'code to disable some controls
Case In Progress
'code to disable some controls
Case Ready to Approve
'code to disable some controls
Case Approved
'code to disable some controls
Case Else
Call MsgBox("Case statement didn't catch", vbInformation, "Tempvar test for case statements")
End Select
End Sub
TempVar
다른 형태로 다음과 같이 설정 : 내가 Case "Entered"
로 Case
설정을 시도했습니다
Dim StrUserInput1 As String
TempVars("CurrentStatus").Value = DLookup("Status", "Control", "Status = '" & StrUserInput1 & "'")
'This is set by comparing the user input vs allowed status (for reports which is yet to be implemented)
하지만 항상 첫 번째 경우를 선택 , 올바른 것이 아닙니다. 위와 같이 형식을 지정하면 결과는 Case Else
입니다. 올바른 결과가 나타나지 않는 이유 또는 방법에 대한 통찰력을 제공하는 사람이 있습니까?
'Option Explicit' 없이는 오류없이 컴파일됩니다. – SeanC
@SeanCheshire - 예, 항상'Option Explicit'이 사용되고 있다고 가정하고, 그 곳을 찾았습니다. – LittleBobbyTables
도움을 주셔서 감사합니다. 'Option Explicit'을 자주 사용하십시오 : S – Deafdan