Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

RE: Validating field within print single record code

Discussion in 'Information Technology' started by Ofer, Nov 7, 2005.

  1. Ofer

    Ofer
    Expand Collapse
    Guest

    Just incase the value of the combo is Null and not empty, then try this

    If Len("" & Me.cboLimits) = 0 Then
    Msgbox "Enter limitations, if any."
    Me.cboLimits.SetFocus
    Exit Sub
    Else
    DoCmd.OpenReport strReport, acViewPreview, , strWhere
    End If

    --
    The next line is only relevant to Microsoft''s web-based interface users.
    If I answered your question, please mark it as an answer. It''s useful to
    know that my answer was helpful
    HTH, good luck


    "Karl H" wrote:

    > Hi,
    > This code worked for a while, then stopped. I'm trying to be sure the
    > client completes a "Limitation" field called cboLimits, before printing, and
    > I have the following code:
    >
    > If Me.Dirty Then 'Save any edits.
    > Me.Dirty = False
    > End If
    >
    > If Me.NewRecord Then 'Check there is a record to print
    > Msgbox "Select a record to print"
    > Else
    > strWhere = "[ID] = " & Me.[ID]
    > If cboLimits = "" Then
    > Msgbox "Enter limitations, if any."
    > Me.cboLimits.SetFocus
    > Exit Sub
    > Else
    > DoCmd.OpenReport strReport, acViewPreview, , strWhere
    > End If
    > End If
    > End Sub
    >
    > It doesn't seem to be evaluating the cboLimits field, and just prints an
    > empty space in the field on the report.
    >
    > Am I missing something?
    >
    > Thank you,
    > Karl
     
  2. Loading...


Share This Page