Hi!
Sorry about the question with the same name, I clicked on the wrong button.
I have a report that displays data from a query. One of the columns displays a checkbox. I want to lookup a value in a different query and display a value IF THE CHECKBOX IS FALSE (not ticked) under the Managers column. My report has this columns:
ID - Name - Checkbox - Manager
txtSupplier_ID is my textbox name for ID data
txtManager is my textbox for Manager data
This is the code I tried but it does not correspond to the right data.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If (Primary = False) Then
Dim first As Variant
Dim last As Variant
Dim manName As Variant
Dim id As Integer
id = txtSupplier_ID.Value
first = DLookup("[FirstName]", "qryReport_lookup", "[Supplier_ID] = " & id)
last = DLookup("[LastName]", "qryReport_lookup", "[Supplier_ID] = " & id)
manName = first & " " & last
txtManager.Value = manName
End If
End Sub
Thanks
M.
Sorry about the question with the same name, I clicked on the wrong button.
I have a report that displays data from a query. One of the columns displays a checkbox. I want to lookup a value in a different query and display a value IF THE CHECKBOX IS FALSE (not ticked) under the Managers column. My report has this columns:
ID - Name - Checkbox - Manager
txtSupplier_ID is my textbox name for ID data
txtManager is my textbox for Manager data
This is the code I tried but it does not correspond to the right data.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If (Primary = False) Then
Dim first As Variant
Dim last As Variant
Dim manName As Variant
Dim id As Integer
id = txtSupplier_ID.Value
first = DLookup("[FirstName]", "qryReport_lookup", "[Supplier_ID] = " & id)
last = DLookup("[LastName]", "qryReport_lookup", "[Supplier_ID] = " & id)
manName = first & " " & last
txtManager.Value = manName
End If
End Sub
Thanks
M.