Hi Guys,
This problem seems simple but it makes no sense. I have a combo box on my form that isn't displaying it's underlying value in the table. The code is simple enough and works for all other combo boxes on the form. I don't understand what's going on. The offending code is in bold. The code is:
Code:
Private Sub LoadCardFields()
ResetFields
txtCardName.SetFocus
If Not IsNull(rsCards("Card Name")) Then
txtCardName.Text = rsCards("Card Name")
Else
txtCardName.Text = vbNullString
End If
If Not IsNull(rsCards("Category ID")) Then
cmbCardCategory.Value = rsCards("Category ID")
Else
cmbCardCategory.Value = -1
End If
If Not IsNull(rsCards("Attribute ID")) Then
cmbCardAttribute.Value = rsCards("Attribute ID")
Else
cmbCardAttribute.Value = -1
End If
txtLevel.SetFocus
If Not IsNull(rsCards("Level")) Then
txtLevel.Text = rsCards("Level")
Else
txtLevel.Text = vbNullString
End If
If Not IsNull(rsCards("Monster ID")) Then
cmbMonsterType.Value = rsCards("Monster ID")
Else
cmbMonsterType.Value = -1
End If
txtAttackPoints.SetFocus
If Not IsNull(rsCards("Attack Points")) Then
txtAttackPoints.Text = rsCards("Attack Points")
Else
txtAttackPoints.Text = vbNullString
End If
txtDefensePoints.SetFocus
If Not IsNull(rsCards("Defense Points")) Then
txtDefensePoints.Text = rsCards("Defense Points")
Else
txtDefensePoints.Text = vbNullString
End If
txtPendulumScale.SetFocus
If Not IsNull(rsCards("Pendulum Scale")) Then
txtPendulumScale.Text = rsCards("Pendulum Scale")
Else
txtPendulumScale.Text = vbNullString
End If
txtLevel.SetFocus
If Not IsNull(rsCards("Level")) Then
txtLevel.Text = rsCards("Level")
Else
txtLevel.Text = vbNullString
End If
txtDescription.SetFocus
If Not IsNull(rsCards("Description")) Then
txtDescription.Text = rsCards("Description")
Else
txtDescription.Text = vbNullString
End If
If Not IsNull("Forbidden") Then
chkForbidden.Value = rsCards("Forbidden")
Else
chkForbidden.Value = False
End If
txtCardName.SetFocus
CheckCardCategory
LoadCardTypeData
End Sub