Update form from another

renenger

Registered User.
Local time
Today, 11:51
Joined
Oct 25, 2002
Messages
117
I have a form called frmSpecificDelivery. A user access this form to look at delivery information for each job. On this form is a command button called History. The user clicks this and opens a History form where they enter dates as the job travels through each department in our manufacturing plant. I would like to automate the status field on the main form.

If the user input a date for the prodction field, then the status on the main form should change from "In Layout" to "Ready for Production". I am not quite sure how to do this.

This is kind of where I was going but I keep getting an error.


Private Sub Command45_Click()
Call UpdateStatus
DoCmd.Close
DoCmd.RunCommand acCmdSaveRecord
Forms![frmSpecificDelivery].Requery
DoCmd.RunCommand acCmdSaveRecord

End Sub


Private Sub UpdateStatus()
If Me.Production Is Not Null Then
Forms!frmSpecificDelivery.Form.Status = "Ready for Production"
Else
End If

End Sub
 
The Sub UpdateStatus would be:

Private Sub UpdateStatus()
If Me.Production Is Not Null Then
SysCmd acSysCmdSetStatus, "Ready for Production"
Else
SysCmd acSysCmdClearStatus
End If

End Sub
 
Thanks for replying back. But I am getting an Object required error 424 with this. It highlights

If Me.Production Is Not Null Then

This whole form is dates throughout the plant.

Production
Sander
Prefinished
Assembly
Paint
Floor
ShipDate
InstallDate

So, for instance when a production date is put in, then I would like the status on the main for to change to Ready for Production. Then when the Sander date in input, then the status would change to Sander. etc...
 
Ok. I think I have this figured out. I added an unbound field to the frmDates. Each time one of those date fields is updated it populates the unbound field CurrentStatus with the correct status.

I created a module that takes the information in CurrentStatus and put it's in the frmSpecificDelivery status field.

My problem is if the user just opens that form to view it, CurrentStatus does not get populated and when you return to the main form, it blanks out the status that was in there.

How can I avoid this?

Public Function TransferStatus()

Forms!frmSpecificDelivery.Form.Status = Forms!frmDates.Form.CurrentStatus

End Function
 

Users who are viewing this thread

Back
Top Bottom