Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    warn if the first option is Null (Access 2000)

    I have 2 option boxes in a form : optionbox Office with 7 options and
    Option FrameCalls with 7 options.On the OnClick event of the option box FrameCalls I have the following function:
    Public Function FncCalls()
    Dim stDocName As String
    Select Case Forms![FBenchmark]![FrameCalls]

    Case 1
    stDocName = "Doc1

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: warn if the first option is Null (Access 2000)

    If you set a default value for the Office option group, this option group will always have a value. If that is not feasible for you, you should test whether the value of the option group is null, and if so, get out of the function.

    Remark: if you really wan to open reports named Doc to Doc7, you can omit the Select Case ... End Select part, and simply concatenate "Doc" with the value of the FrameCalls option group.

    Public Function FncCalls()
    Dim stDocName As String

    If IsNull(Forms![FBenchMark]![]Office]) Then
    MsgBox "Please select an office", vbExclamation
    Exit Function
    End If

    stDocName = "Doc" & Forms![FBenchmark]![FrameCalls]
    DoCmd.OpenReport stDocName, acViewPreview
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •