How to confirm value of field a based on value of field b?

PartsPig

New Member
Joined
Sep 13, 2024
Messages
35
Office Version
  1. 365
Platform
  1. Windows
I am trying to confirm if a work order (RONum) is still in Open status (IsOpen). My table has may lines for each work order but they should all have the same value for IsOpen. I am trying to find one line item with a match to RONum and return the value of IsOpen. Below is the code I started with but I am getting an error "Object Required." I am using a simple form to test the functionality but will then use the solution in another more complicated form. Any assistance will be appreciated.

VBA Code:
Private Sub Go_Click()
    Dim strRO As String
    Dim blnIsOpen As Boolean
    
    blnIsOpen = True
    strRO = txtRONum
    'MsgBox "strRO = " & strRO, vbOKOnly
    
    If tblPartsTracking.RONum = strRO And tblPartsTracking.IsOpen = True Then
        MsgBox "RO " & strRO & " is open.", vbOKOnly
    Else
        MsgBox "RO " & strRO & " is closed.", vbOKOnly
    End If

End Sub

Object Required.PNG
 

Forum statistics

Threads
1,226,771
Messages
6,192,918
Members
453,766
Latest member
Gskier

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top