Hi,
Hoping to get some assistance here. I have a DLookup code below that works fine for retrieving information, "CENTRE" from a table called "CodeLook",
Private Sub SpecNo_AfterUpdate()
On Error GoTo Err_SpecNo_AfterUpdate
Dim strFilter As String
Dim strFilter1 As String
Dim FoundConsigneeID As String
Dim FoundConsigneeID1 As String
strFilter = "CODE = " & Me!SpecNo
FoundConsigneeID = Nz(DLookup("CENTRE", "CodeLook", strFilter))
If Trim(FoundConsigneeID & "") = "" Then
MsgBox "No Consignee match could be found for this Spec Code ", vbOKOnly + vbCritical, "Default Consignee Lookup"
Else
MsgBox "Scheduled Agreement match found", vbInformation, "Default Scheduled Agreement"
Me!ConsigneeID = FoundConsigneeID
End If
And I have another table, "GCAS" which I would like to retrieve informtion, "Sched"
I have the following code below but can't seem to get my head around the If, then and Else to incorporate to the above code
strFilter1 = "Spec = " & Me!SpecNo
FoundConsigneeID1 = Nz(DLookup("Sched", "GCAS", strFilter))
If Trim(FoundConsigneeID1 & "") = "" Then
MsgBox "No Scheduled Agreement match found?", vbOKOnly + vbCritical, "Default PO Lookup"
Else
MsgBox "Scheduled Agreement match found", vbInformation, "Default Scheduled Agreement"
Me!PurchaseOrderNo = FoundConsigneeID1
Any assistance would be greatly appreciated,
Steve
Hoping to get some assistance here. I have a DLookup code below that works fine for retrieving information, "CENTRE" from a table called "CodeLook",
Private Sub SpecNo_AfterUpdate()
On Error GoTo Err_SpecNo_AfterUpdate
Dim strFilter As String
Dim strFilter1 As String
Dim FoundConsigneeID As String
Dim FoundConsigneeID1 As String
strFilter = "CODE = " & Me!SpecNo
FoundConsigneeID = Nz(DLookup("CENTRE", "CodeLook", strFilter))
If Trim(FoundConsigneeID & "") = "" Then
MsgBox "No Consignee match could be found for this Spec Code ", vbOKOnly + vbCritical, "Default Consignee Lookup"
Else
MsgBox "Scheduled Agreement match found", vbInformation, "Default Scheduled Agreement"
Me!ConsigneeID = FoundConsigneeID
End If
And I have another table, "GCAS" which I would like to retrieve informtion, "Sched"
I have the following code below but can't seem to get my head around the If, then and Else to incorporate to the above code
strFilter1 = "Spec = " & Me!SpecNo
FoundConsigneeID1 = Nz(DLookup("Sched", "GCAS", strFilter))
If Trim(FoundConsigneeID1 & "") = "" Then
MsgBox "No Scheduled Agreement match found?", vbOKOnly + vbCritical, "Default PO Lookup"
Else
MsgBox "Scheduled Agreement match found", vbInformation, "Default Scheduled Agreement"
Me!PurchaseOrderNo = FoundConsigneeID1
Any assistance would be greatly appreciated,
Steve