Gustav Brock
Gustav at cactus.dk
Thu Mar 24 03:21:24 CST 2005
Hi J It sure can. But apply proper indenting to get the code readable and at once you'll see why it apparently didn't: Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.SmpleSizeAll.Value = True Then Me.txtSmplSize = "All Pieces" Else Me.txtSmplSize = "SizeAll Value is False" If Me.SmpleSizePieces.Value <> 0 Then Me.txtSmplSize = Me.SmpleSizePieces Else Me.txtSmplSize = "No Samples Needed" End If End If End Sub Perhaps this is what you had in mind: Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.SmpleSizeAll.Value = True Then Me.txtSmplSize = "All Pieces" ElseIf Me.SmpleSizePieces.Value <> 0 Then Me.txtSmplSize = Me.SmpleSizePieces Else Me.txtSmplSize = "No Samples Needed" End If End Sub /gustav >>> jmhla at earthlink.net 03/24 8:01 am >>> I built the following code using the autocomplete in the VB editor. Why can't Access find the smpleSizeAll in the code? Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.SmpleSizeAll.Value = True Then Me.txtSmplSize = "All Pieces" Else If Me.SmpleSizePieces.Value <> 0 Then Me.txtSmplSize = Me.SmpleSizePieces Else Me.txtSmplSize = "No Samples Needed" End If End If End Sub