Page 13 of 16 FirstFirst ... 345678910111213141516 LastLast
Results 181 to 195 of 238
  1. #181
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    I have the code below that works to open a report that includes both the events GTI-08a and GTI-08a Checkout.



    Code:
    Private Sub SystemResultsButton_Click()'User must select a value from the combo box
       If IsNull(cboSelectEvent) = True Then
          MsgBox "You must select an Event."
    
    
       'Open report called EventSystemPerformance_rpt where the Event field
       ' contains the value in the cboSelectEvent combo box
       Else
          DoCmd.OpenReport "EventSystemPerformance_rpt", acViewPreview, , "Event like '*" & cboSelectEvent & "*'"
       End If
    End Sub
    I need to tweak that code so that it only shows either GTI-08a or GTI-08a Checkout based on the dropdown selection. I know it is the "Event like '*" portion, I'm must not sure what it should be changed to. Should I just remove the * ?

  2. #182
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Well, the first * will get you things like "blah blah GTI-08a blah". If you only want records that start with whatever is in the combo, drop the first *:

    DoCmd.OpenReport "EventSystemPerformance_rpt", acViewPreview, , "Event like '" & cboSelectEvent & "*'"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #183
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Quote Originally Posted by pbaldy View Post
    Well, the first * will get you things like "blah blah GTI-08a blah". If you only want records that start with whatever is in the combo, drop the first *:

    DoCmd.OpenReport "EventSystemPerformance_rpt", acViewPreview, , "Event like '" & cboSelectEvent & "*'"
    Thanks Paul. I did try that and it still returns both of the events.

  4. #184
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Removing both * did the trick:

    Code:
    DoCmd.OpenReport "EventSystemPerformance_rpt", acViewPreview, , "Event like '" & cboSelectEvent & "'"

  5. #185
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Oh sorry, you want only an exact match? Try:

    DoCmd.OpenReport "EventSystemPerformance_rpt", acViewPreview, , "Event = '" & cboSelectEvent & "'"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #186
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Quote Originally Posted by pbaldy View Post
    Oh sorry, you want only an exact match? Try:

    DoCmd.OpenReport "EventSystemPerformance_rpt", acViewPreview, , "Event = '" & cboSelectEvent & "'"
    Yep, that does it. both wildcards had to be removed.

  7. #187
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Note I also changed Like to =.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #188
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Earlier in this thread we worked out a bunch of validation code for my Run Sheet form. After using the Run Sheet in the real world for a while, it has been determined that I need to add to the validation rules. What I need to do is have all validation rules ignored if the combobox "RunAssessment" equals "Aborted". Is there a way to do this?

    For reference, here is the current code used on the submit button that contains all of the validation rules:

    Code:
    Private Sub EventCombo_AfterUpdate()ScenarioCombo.Requery
    
    
    End Sub
    
    
    Private Sub Form_BeforeUpdate(Cancel As Integer)
    'BOA nominal or off nominal
    If (Me.BOARunResults = "Nominal" Or Me.BOARunResults = "Off Nominal") Then   'start BOA checks
    
    
        'BOA Operator
        If IsNull(Me.BOAOperator) Then
        MsgBox "Please select a BOA Operator", vbInformation, "Atention!"
            Cancel = True
            Me.BOAOperator.SetFocus
        Exit Sub
        End If
    
    
        'BOATracksExpected
        If IsNull(Me.BOATracksExpected) Then
        MsgBox "Please enter the number of Tracks Expected for BOA", vbInformation, "Atention!"
            Cancel = True
            Me.BOATracksExpected.SetFocus
        Exit Sub
        End If
    
    
        'BOATracksReceived
        If IsNull(Me.BOATracksReceived) Then
        MsgBox "Please enter the number of Tracks Received for BOA", vbInformation, "Atention!"
            Cancel = True
            Me.BOATracksReceived.SetFocus
        Exit Sub
        End If
    
    
        'BOATracksProcessed
        If IsNull(Me.BOATracksProcessed) Then
        MsgBox "Please enter the number of Tracks Processed by BOA", vbInformation, "Atention!"
            Cancel = True
            Me.BOATracksProcessed.SetFocus
        Exit Sub
        End If
    
    
        'BOATracksReleased
        If IsNull(Me.BOATracksReleased) Then
            MsgBox "Please enter the number of Tracks Released by BOA", vbInformation, "Atention!"
            Cancel = True
            Me.BOATracksReleased.SetFocus
        Exit Sub
        End If
    
    
        'BOAComms
        If IsNull(Me.BOAComms) Then
        MsgBox "Please select the comms type that was used for BOA", vbInformation, "Atention!"
            Cancel = True
            Me.BOAComms.SetFocus
        Exit Sub
        End If
            
    End If ' end of BOA Checks
    
    
    
    
    
    
    If (Me.SBIRSRunResults = "Nominal" Or Me.SBIRSRunResults = "Off Nominal") Then 'start SBIRS checks
    
    
       'SBIRSSIMOperator
        If IsNull(Me.SBIRSSIMOperator) Then
        MsgBox "Please select a SBIRS SIM Controller", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSSIMOperator.SetFocus
        Exit Sub
        End If
    
    
        'SBIRSTracksExpected
        If IsNull(Me.SBIRSTracksExpected) Then
        MsgBox "Please enter the number of Tracks Expected for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSTracksExpected.SetFocus
        Exit Sub
        End If
    
    
        'SBIRSTracksReceived
        If IsNull(Me.SBIRSTracksReceived) Then
        MsgBox "Please enter the number of Tracks Received for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSTracksReceived.SetFocus
        Exit Sub
        End If
    
    
        'SBIRSTracksProcessed
        If IsNull(Me.SBIRSTracksProcessed) Then
        MsgBox "Please enter the number of Tracks Processed for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSTracksProcessed.SetFocus
        Exit Sub
        End If
    
    
        'SBIRSTracksReleased
        If IsNull(Me.SBIRSTracksReleased) Then
        MsgBox "Please enter the number of Tracks Released for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSTracksReleased.SetFocus
        Exit Sub
        End If
        
        'SBIRSUnscripted
        If IsNull(Me.SBIRSUnscripted) Then
        MsgBox "Please enter the number of Unscripted Boosters for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSUnscripted.SetFocus
        Exit Sub
        End If
    
    
        'SBIRSComms
        If IsNull(Me.SBIRSComms) Then
        MsgBox "Please select the comms type that was used for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSComms.SetFocus
        Exit Sub
        End If
         
        'SBIRSWorkstation
        If Len(Nz(Me.SBIRSWorkstation1, "") & Nz(Me.SBIRSWorkstation2, "") & Nz(Me.SBIRSWorkstation3, "") & Nz(Me.SBIRSWorkstation4, "") & Nz(Me.SBIRSWorkstation5, "")) = 0 Then
            MsgBox "Please select an Operator for the SBIRS Workstation that was used", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSWorkstation1.SetFocus
        Exit Sub
        End If
    
    
    End If 'end of SBIRS checks
        
    End Sub
    
    
    Private Sub SubmitRSButton_Click()
    On Error GoTo Err_Handler
    
    
    
    
    Me.Dirty = False
    
    
    
    
    If MsgBox("Record has been submitted! Do you want to go to a new record?", vbYesNo, "New record?") = vbYes Then
    DoCmd.GoToRecord , , acNewRec
    End If
    Exit_Here:
        Exit Sub
    
    
    
    
    Err_Handler:
        If Err.Number = 3021 Then
        'ignore or message
    Else
        MsgBox Err.Number & " " & Err.Description
    End If
    
    
    
    
    Resume Exit_Here
    
    
    End Sub

  9. #189
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Please try this:
    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
    
    
    If Me.RunAssessment <>"Aborted" Then 'Vlad Sep 10,2020 only run the validations if not aborted
    
    
    'BOA nominal or off nominal
    If (Me.BOARunResults = "Nominal" Or Me.BOARunResults = "Off Nominal") Then   'start BOA checks
    
    
    
    
        'BOA Operator
        If IsNull(Me.BOAOperator) Then
        MsgBox "Please select a BOA Operator", vbInformation, "Atention!"
            Cancel = True
            Me.BOAOperator.SetFocus
        Exit Sub
        End If
    
    
    
    
        'BOATracksExpected
        If IsNull(Me.BOATracksExpected) Then
        MsgBox "Please enter the number of Tracks Expected for BOA", vbInformation, "Atention!"
            Cancel = True
            Me.BOATracksExpected.SetFocus
        Exit Sub
        End If
    
    
    
    
        'BOATracksReceived
        If IsNull(Me.BOATracksReceived) Then
        MsgBox "Please enter the number of Tracks Received for BOA", vbInformation, "Atention!"
            Cancel = True
            Me.BOATracksReceived.SetFocus
        Exit Sub
        End If
    
    
    
    
        'BOATracksProcessed
        If IsNull(Me.BOATracksProcessed) Then
        MsgBox "Please enter the number of Tracks Processed by BOA", vbInformation, "Atention!"
            Cancel = True
            Me.BOATracksProcessed.SetFocus
        Exit Sub
        End If
    
    
    
    
        'BOATracksReleased
        If IsNull(Me.BOATracksReleased) Then
            MsgBox "Please enter the number of Tracks Released by BOA", vbInformation, "Atention!"
            Cancel = True
            Me.BOATracksReleased.SetFocus
        Exit Sub
        End If
    
    
    
    
        'BOAComms
        If IsNull(Me.BOAComms) Then
        MsgBox "Please select the comms type that was used for BOA", vbInformation, "Atention!"
            Cancel = True
            Me.BOAComms.SetFocus
        Exit Sub
        End If
            
    End If ' end of BOA Checks
    
    
    
    
    
    
    
    
    
    
    
    
    If (Me.SBIRSRunResults = "Nominal" Or Me.SBIRSRunResults = "Off Nominal") Then 'start SBIRS checks
    
    
    
    
       'SBIRSSIMOperator
        If IsNull(Me.SBIRSSIMOperator) Then
        MsgBox "Please select a SBIRS SIM Controller", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSSIMOperator.SetFocus
        Exit Sub
        End If
    
    
    
    
        'SBIRSTracksExpected
        If IsNull(Me.SBIRSTracksExpected) Then
        MsgBox "Please enter the number of Tracks Expected for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSTracksExpected.SetFocus
        Exit Sub
        End If
    
    
    
    
        'SBIRSTracksReceived
        If IsNull(Me.SBIRSTracksReceived) Then
        MsgBox "Please enter the number of Tracks Received for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSTracksReceived.SetFocus
        Exit Sub
        End If
    
    
    
    
        'SBIRSTracksProcessed
        If IsNull(Me.SBIRSTracksProcessed) Then
        MsgBox "Please enter the number of Tracks Processed for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSTracksProcessed.SetFocus
        Exit Sub
        End If
    
    
    
    
        'SBIRSTracksReleased
        If IsNull(Me.SBIRSTracksReleased) Then
        MsgBox "Please enter the number of Tracks Released for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSTracksReleased.SetFocus
        Exit Sub
        End If
        
        'SBIRSUnscripted
        If IsNull(Me.SBIRSUnscripted) Then
        MsgBox "Please enter the number of Unscripted Boosters for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSUnscripted.SetFocus
        Exit Sub
        End If
    
    
    
    
        'SBIRSComms
        If IsNull(Me.SBIRSComms) Then
        MsgBox "Please select the comms type that was used for SBIRS", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSComms.SetFocus
        Exit Sub
        End If
         
        'SBIRSWorkstation
        If Len(Nz(Me.SBIRSWorkstation1, "") & Nz(Me.SBIRSWorkstation2, "") & Nz(Me.SBIRSWorkstation3, "") & Nz(Me.SBIRSWorkstation4, "") & Nz(Me.SBIRSWorkstation5, "")) = 0 Then
            MsgBox "Please select an Operator for the SBIRS Workstation that was used", vbInformation, "Atention!"
            Cancel = True
            Me.SBIRSWorkstation1.SetFocus
        Exit Sub
        End If
    
    
    
    
    End If 'end of SBIRS checks
    
    
    End if 'Vlad Sep 10,2020 only run the validations if not aborted
        
    End Sub
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  10. #190
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Okay, so maybe this is not what I wanted/how I wanted it to work. The following fields in my form are required in the underlying table. "RunNumber", "StartPDU", "StartMission", and "StopPDU". I'm also wanting to ignore those (make them not required) if the Run Assessment is "Aborted" as well as skipping the validation I posted above.

    I'm not sure if that is possible or if I would need to make those fields not required in the table and add a validation to them in my code to make sure data gets entered into them unless the run was Aborted.

  11. #191
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You would need to remove the required restriction and do the validation in code.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #192
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Thanks Paul, I'll give that a shot.

  13. #193
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problem, post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  14. #194
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Thanks Vlad and Paul, switching those fields to not required and the code above got me what I needed.

  15. #195
    Etoimos is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Mar 2020
    Posts
    249
    Hey Vlad and Paul,

    I'm back with a follow up to the DSR report that we worked on earlier in this thread. The powers that be do not like having the BLUF section shown on every page. They just want it to show up on the first page and then on all subsequent pages to just have the Run Results subform displayed. I can't figure out how to do this.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 10-13-2014, 09:20 AM
  2. Replies: 6
    Last Post: 02-19-2014, 11:11 AM
  3. Replies: 3
    Last Post: 07-03-2013, 10:38 AM
  4. Replies: 1
    Last Post: 10-30-2012, 10:29 AM
  5. Replies: 1
    Last Post: 07-11-2012, 08:36 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