Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate string with field?

Status
Not open for further replies.

cabbey77

Technical User
Aug 6, 2004
68
US
Here is my macro how I have it written:

Sub Job_Title()
If Field$("PS_JOB.DEPTID") = "0733118200" Then
D = "CMP"+Field$("PS_JOBCODE_TBL.DESCR")
Else
D = Field$("PS_JOBCODE_TBL.DESCR")
DERIVEDFIELD D
End If
End Sub

I get the proper string on all other Titles except the one where the Field is = to 0733..., where I get NA.
 
Try this: (end the if statement before the derivedfield statement)

Sub Job_Title()
If Str$(Val(Field$("PS_JOB.DEPTID"))) = Str$(0733118200) Then
D = "CMP"+Str$(Val(Field$("PS_JOBCODE_TBL.DESCR")))
Else
D = Field$("PS_JOBCODE_TBL.DESCR")
End If

DERIVEDFIELD D

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top