Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Conlict of functions (Access 2000)

    How could i avoid a conflict between two functions? I have 2 functions that set the caption of two labels.However taken together these functions do not work properly. if for example i use the second option box only and not together
    with the first option box, then the results are false.Cani combine these functions into one ?

    Public Function Branching() As String
    ' this function sets the names of the office in the control names Heading.'
    ' each report has a control named heading
    Select Case Nz(Forms![Main]![Office])
    Case 1
    Branching = " Willi"
    Case 2
    Branching = " Mesta"
    Case 3
    Branching = " Listo"
    Case 4
    Branching = " annecutis"

    Branching = " All offices"
    End Select
    ' Then, change the report OnOpen event to call this function:
    'Private Sub Report_Open(Cancel As Integer)
    'Me![heading].Caption = Branching
    End Function
    Public Function SubAds() As String
    ' this function sets the names of the office in the control names SubHeading.'
    ' each report has a control named heading
    Select Case Nz(Forms![Main]![Office])
    Case 1
    SubAds = " trolley"
    Case 2
    SubAds = " signs"
    Case 3
    SubAds = " flags"
    Case 4
    SubAds = " boilers"
    Case 6

    Case Else
    SubAds = " all"
    End Select
    ' Then, change the report OnOpen event to call this function:
    'Private Sub Report_Open(Cancel As Integer)
    'Me![SubHeading].Caption = SubAds
    End Function

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

    Re: Conlict of functions (Access 2000)

    1) In the Branching function, you have omitted the line

    Case Else

    before the line

    Branching = " All offices"

    2) In the SubAds function, you should change

    Select Case Nz(Forms![Main]![Office])

    to

    Select Case Nz(Forms![Main]![Ads])

  3. #3
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Conlict of functions (Access 2000)

    Hans, Thank you. Sorry for my stupid mistake

Posting Permissions

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