Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    megatronixs is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    91
    Hi all,



    If I want to add 3 more (Working on, Awaiting Information and Frozen case), how can I do this?

    Code:
    Private Sub cmbo_query_categorization_AfterUpdate()
          Me.expected_resolution_time = IIf(Me.cmbo_query_categorization = "non standard", CDate(Me!date_received) + 5 + SkipWeekends(CDate(Me!date_received) + 5), (Me.cmbo_query_categorization = "Working on", CDate(Me!date_received) + 5 + SkipWeekends(CDate(Me!date_received) + 5), CDate(Me!date_received) + 2 + SkipWeekends(CDate(Me!date_received) + 2))
    End Sub
    When I try it in the above code, I get here an error on the coma (,) after the "non standard":
    Code:
    Me.expected_resolution_time = IIf(Me.cmbo_query_categorization = "non standard",
    Greetings.

  2. #17
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    If I want to add 3 more (Working on, Awaiting Information and Frozen case),
    3 more what?? Options in the combo box, controls to have the time,.......?


    Sorry, my crystal ball is in the shop.

  3. #18
    megatronixs is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    91
    Hi, sorry if it was not that clear, I will try to be more clear now, like your crhstall ball :-)

    I have added 3 more options in the combobox and if I select "Frozen case" I should get 20 more working days for that type of case, 10 more for "awaiting information" and 7 for "working on".
    I guess that changing it the way I tried above will not work, what if using a select case? (I tried it yesterday, but so far no luck)

    Greetings.

  4. #19
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Maybe try this:
    Code:
    Private Sub cmbo_query_categorization_AfterUpdate()
        Dim cmboQryCat As String
        Dim DaysToAdd As Integer  'how many days to add based on the selection in combo box
    
        cmboQryCat = Me.cmbo_query_categorization
        
        Select Case cmboQryCat
            Case "Frozen case"
                DaysToAdd= 20
            Case "awaiting information"
                DaysToAdd= 10
            Case "non standard"
                DaysToAdd= 10
            Case "working on"
                DaysToAdd= 7
            Case Else
                DaysToAdd= 2
        End Select
    
        Me.expected_resolution_time = CDate(Me!date_received) + SkipWeekends(CDate(Me!date_received) + DaysToAdd)
    
    End Sub

  5. #20
    megatronixs is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    91
    Hi,

    This worked our really nice :-)
    Would have taken me 1000 years and plenty more crystal balls :-)

    Thanks a lot.

  6. #21
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You're welcome. Good luck with your project.....

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 03-27-2015, 03:42 PM
  2. Replies: 42
    Last Post: 03-01-2013, 06:58 AM
  3. Calculate time
    By funkygoorilla in forum Access
    Replies: 19
    Last Post: 08-25-2011, 09:34 PM
  4. Replies: 1
    Last Post: 05-21-2011, 01:33 AM
  5. Run-time '3051' - Too few parameters. Expected 1
    By jgelpi16 in forum Programming
    Replies: 3
    Last Post: 04-11-2011, 07:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums