Syntax Problem?

Kila

Registered User.
Local time
Today, 17:41
Joined
Mar 5, 2003
Messages
275
I am working on a report that displays different things in [txtRecAction] based what is in various fields in the underlying query. I have this so far:

Code:
If Action Like "Enter New*" Then
    Me.txtRecAction = Date
ElseIf Action Like "Terminate - Transfer*" Then
    Me.txtRecAction = Trim([RRBText] & [ActionComment])
Else
    Me.txtRecAction = ActionComment
End If

...But it is not working properly. I suspect it is just a syntax problem. It seems to only display the comments in [ActionComment], even though there are records in the underlying query that fit the other criteria.

[txtRecAction] is an unbound field in the detail area of the report.

[Action], [Date], [RRBText], and [ActionComment] all refer to fields in the underlying query in the record that is currently displayed in "detail".

Thanks for any help you can offer.
 
Resolved(?) but I am not sure why it did not work the other way

This is what I have now...

Code:
If txtAction Like "Enter New*" Then
    Me.txtRecAction = Date
    Me.txtEffectiveDate = PayStatus
    Me.txtSpecialty = Specialties
ElseIf txtAction Like "Terminate - Transfer*" Then
    Me.txtRecAction = Trim([RRBText] & [ActionComment])
    Me.txtEffectiveDate = Date
    Me.txtSpecialty = Specialties
ElseIf txtActionComment Like "Transfer*" Then
    Me.txtRecAction = RRBText
    Me.txtSpecialty = ActionComment
    Me.txtEffectiveDate = Date
Else
    Me.txtRecAction = RRBText
    Me.txtEffectiveDate = Date
    Me.txtSpecialty = Specialties
End If

BUT, each "If txtFieldName" references a field in the "Detail" area of the report that points at a field in the query named FieldName. Why does it not work if I just say "FieldName"? :confused:
 

Users who are viewing this thread

Back
Top Bottom