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!

Print the word "DONE" based on a related value in Form 1

Status
Not open for further replies.

jsteff

Technical User
May 22, 2003
109
US
Very simple request....(i thought)

In the form is the field, STATUS. I creted a "label" field (TaskStat) to simply display the word DONE in the lower corner of the form.

So: IF the STATUS field=6 then print the word "DONE" in the label field (TaskStat). I want this to happen as the user clicks the "next screen" arrow provided by Access at the bottom of the screen.

In the field status, "Before Update", I entered:
IIF([FORMS]![MAIN]![STATUS]=6, [FORMS]![MAIN]![TaskStatDisp]='DONE','')

When I open the form and manipulate the STATUS field, it errors out referring to "invalid macro"

Help!!!


 
Code:
If Status=6 then
forms!Main!TaskStat="Done"
end if

Also you have
I creted a "label" field (TaskStat)

But then you use
[FORMS]![MAIN]![TaskStatDisp]='DONE'
Make sure you are useing the correct label name.

Just for my on sake...when does the status = 6? hth
 
I added this code as you suggested:
Private Sub Status_BeforeUpdate(Cancel As Integer)
If Status = 6 Then
Forms!MAIN!TaskStatDisp = "DONE"
End If
End Sub

When I step through the field "Status", I get the error:
Run-time error "438"
Object doesn't support this property or method.

FYI: the object "Status" is a drop down box that takes the numeric value of "Status" and converts it to a descriptive term. For example if Status=6 then the word in the box is "DONE".

Any ideas????? thanks.
 
Try this:
Code:
Forms!MAIN!TaskStatDip.[b]Caption[/b]="DONE"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top