change default value for combo box - more info

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've just realised that my combo boxes are actually three columns wide, with
the first column being the bound column, with a 0 display width. The value
that I want to display is a default value of the second column, which is not
bound. Is this possible?
 
Me again. Sorry for the bother - after writing the question below, it dawned
on me to try to use the value of the first (bound) column in my code - and it
worked!

Thanks.
 
Sue,

I just finished an answer your earlier post and missed this one. Glad you
solved the problem.

I modified you code to make it easier (for me) to read. I used the
IF...ElseIF...Else...End If and the Select Case ...End Select syntax.

'------If...ElseIf....---------------------
Private Sub SwareID_AfterUpdate()
If Me!SwareID = "WILES21L9" Then
Me!QWilcomOpt1 = "Smart Font Wilcom ES21"
Me!QWilcomOptPrice1 = 1000
ElseIf Me!SwareID = "WILES21E9" Then
Me!QWilcomOpt1 = "Smart Font Wilcom ES21"
Me!QWilcomOptPrice1 = 1000
ElseIf Me!SwareID = "WILES21D9" Then
Me!QWilcomOpt1 = "Smart Font Wilcom ES21"
Me!QWilcomOptPrice1 = 1000
Me!QWilcomOpt2 = "Auto Appliqué Wilcom ES21D (requires Input C)"
Me!QWilcomOptPrice2 = 1300
End If

End Sub


'---------- Select Case..End Select ------------

Private Sub SwareID_AfterUpdate()
Select Case Me!SwareID
Case "WILES21L9"
Me!QWilcomOpt1 = "Smart Font Wilcom ES21"
Me!QWilcomOptPrice1 = 1000
Case "WILES21E9"
Me!QWilcomOpt1 = "Smart Font Wilcom ES21"
Me!QWilcomOptPrice1 = 1000
Case "WILES21D9"
Me!QWilcomOpt1 = "Smart Font Wilcom ES21"
Me!QWilcomOptPrice1 = 1000
Me!QWilcomOpt2 = "Auto Appliqué Wilcom ES21D (requires Input C)"
Me!QWilcomOptPrice2 = 1300
Case Else
' what to do if all else fails
End Select
End Sub


Steve
 
Back
Top