johnkrytus
Registered User.
- Local time
- Yesterday, 21:48
- Joined
- Mar 7, 2013
- Messages
- 91
Why is strCreditCheck returning the actual query string and not the result? Of course, this is not working. Please help.
Code:
Private Sub b_PrintWorkOrder_Click()
Me.Requery
Dim strCreditCheck As String
Dim strCompany_id As Integer
Dim stlinkCriteria As String
stlinkCriteria = "[EntryId]=" & [Forms]![People_Enter]![People_Enter_Assignments].Form!EntryId
strCompany_id = [Forms]![People_Enter]![People_Enter_Assignments].Form!company_id
strCreditCheck = "SELECT TermsID FROM companies WHERE company_id = " & strCompany_id
Debug.Print ([strCreditCheck])
If strCreditCheck <> 4 Then
If stlinkCriteria <> "" Then
DoCmd.OpenReport "WorkOrder", acPreview, , stlinkCriteria
DoCmd.Close acForm, "People_Enter"
End If
Else
MsgBox "This company is not yet approved for credit"
End If
End Sub
Last edited: