nycbigapple
Technical User
Hello,
I have an issue with an option group. I have 3 options in the box that has a combobox seelct a list to whichever option is selected. On value #3 instead of it using the combobox, I am trying to let the user input "details" rather than have it selected from a combo. I have an if statement it works. However, when I close the db and reopen it, if option 3 was selected for record 1, it doesn't show that it was selected. Options1 and 2 do show it was selected. When I check the corresponding field in the table it shows that it has a value of 3 in there.
How can I have it show that option3 was is selected. Thanks
Private Sub Form_Current()
If grpCodeType.Value = 3 Then
cboAssessName.Visible = False
txtProcedure.Visible = True
Else
cboAssessName.Visible = True
txtProcedure.Visible = False
'txtProcedure.Value = Null
End If
On Error Resume Next
Dim strCodeType As String
If IsNull(cboAssessName.Value) Then
grpCodeType.Value = Null
End If
' Synchronise CodeType combo with existing AssessmentName
strCodeType = DLookup("[CodeType]", "tblAssess", "[AssessName]='" & cboAssName.Value & "'")
Select Case strCodeType
Case "Equipment"
grpCodeType.Value = 1
Case "Product"
grpCodeType.Value = 2
Case "Detail"
grpCodeType.Value = 3
End Select
' Synchronise AssessmentName combo with existing AssessmentName
cboAssessName.RowSource = "Select tblAssess.AssesName " & _
"FROM tblAssess " & _
"WHERE tblAssess.CodeType = '" & strCodeType & "' " & _
"ORDER BY tblAsses.AssessName;"
Private Sub grpCodeType_AfterUpdate()
cboAssessName.Value = Null
On Error Resume Next
Dim strCodeType As String
If grpCodeType.Value = 3 Then
cboAssessName.Visible = False
txtProcedure.Visible = True
Else
cboAssessName.Visible = True
txtProcedure.Visible = False
txtProcedure.Value = Null
End If
Select Case grpCodeType.Value
Case 1
strCodeType = "Equipment"
Case 2
strCodeType = "Product"
Case 3
' strCodeType = "Detail"
End Select
cboAssName.RowSource = "Select tblAssess.AssessName " & _
"FROM tblAssess " & _
"WHERE tblAssess.CodeType = '" & strCodeType & "' " & _
"ORDER BY tblAssess.AssName;"
End Sub
I have an issue with an option group. I have 3 options in the box that has a combobox seelct a list to whichever option is selected. On value #3 instead of it using the combobox, I am trying to let the user input "details" rather than have it selected from a combo. I have an if statement it works. However, when I close the db and reopen it, if option 3 was selected for record 1, it doesn't show that it was selected. Options1 and 2 do show it was selected. When I check the corresponding field in the table it shows that it has a value of 3 in there.
How can I have it show that option3 was is selected. Thanks
Private Sub Form_Current()
If grpCodeType.Value = 3 Then
cboAssessName.Visible = False
txtProcedure.Visible = True
Else
cboAssessName.Visible = True
txtProcedure.Visible = False
'txtProcedure.Value = Null
End If
On Error Resume Next
Dim strCodeType As String
If IsNull(cboAssessName.Value) Then
grpCodeType.Value = Null
End If
' Synchronise CodeType combo with existing AssessmentName
strCodeType = DLookup("[CodeType]", "tblAssess", "[AssessName]='" & cboAssName.Value & "'")
Select Case strCodeType
Case "Equipment"
grpCodeType.Value = 1
Case "Product"
grpCodeType.Value = 2
Case "Detail"
grpCodeType.Value = 3
End Select
' Synchronise AssessmentName combo with existing AssessmentName
cboAssessName.RowSource = "Select tblAssess.AssesName " & _
"FROM tblAssess " & _
"WHERE tblAssess.CodeType = '" & strCodeType & "' " & _
"ORDER BY tblAsses.AssessName;"
Private Sub grpCodeType_AfterUpdate()
cboAssessName.Value = Null
On Error Resume Next
Dim strCodeType As String
If grpCodeType.Value = 3 Then
cboAssessName.Visible = False
txtProcedure.Visible = True
Else
cboAssessName.Visible = True
txtProcedure.Visible = False
txtProcedure.Value = Null
End If
Select Case grpCodeType.Value
Case 1
strCodeType = "Equipment"
Case 2
strCodeType = "Product"
Case 3
' strCodeType = "Detail"
End Select
cboAssName.RowSource = "Select tblAssess.AssessName " & _
"FROM tblAssess " & _
"WHERE tblAssess.CodeType = '" & strCodeType & "' " & _
"ORDER BY tblAssess.AssName;"
End Sub