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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically update another fields

Status
Not open for further replies.

oggsta

Technical User
Jun 22, 2002
41
0
0
GB
Access forms

The following code should after you update [Sheet1][sitestatus] feild to red automaticaly update the feild [Main]![siteactive] to Site Completed.

Sheet1 is a subform to the form entitlted Main. And both feilds are visable when the form entitlted Main is open.

There is a problem with the syntax in the code, and help apreciated

Thanks

Private Sub Sitestatus_AfterUpdate()

Select Case Me!Sitestatus
Case "Red"
[Main]![siteactive] = "Site Completed"
End Select

Select Case Me!Sitestatus
Case "Blue"
[Main]![siteactive] = "Site Completed"
End Select

Select Case Me!Sitestatus
Case "Purple"
[Main]![siteactive] = "Site Cancelled"
End Select

End Sub
 
I'm expecting this.....

Private Sub Sitestatus_AfterUpdate()

Select Case Me.Sitestatus

Case "Red"
me.siteactive = "Site Completed"

Case "Blue"
me.siteactive = "Site Completed"

Case "Purple"
me.siteactive = "Site Cancelled"

case else
msgbox("Status not valid")

End Select

End Sub
 
Thanks for the reply;

The problem is the feild siteactive is in a different form called Main

I would have through the sytax would have been

Form!Main![siteactive] = "Site Completed"

however this does not work, and idaes why.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top