Xenix
Registered User.
- Local time
- Today, 21:26
- Joined
- Oct 8, 2001
- Messages
- 124
I have a problem. I have a main form for a work order database then a sub form with trays that are filled and going out to outworkers. I want to close the job when all the trays have a complete date but I do not know how to select the next record on the subform to check until end of records?
Can anyone help me?
This is the code I check in each record searched:
If IsNull(Forms!production!TrayDetailsSub3!CompleteDate) Then
Me.complete = False
x = False
'MsgBox "Sorry I can't do that until you enter the Actual Return Date"
Else
'Me.complete = True
x = True
End If
If Forms!production!TrayDetailsSub3!Reworked = True And IsNull(Forms!production!TrayDetailsSub3!ReworkReturn) Then
Me.complete = False
y = False
'MsgBox "Sorry I can't do that until the job has come back from rework and date is entered in Rework Return Date"
Else
y = True
End If
If x = True And y = True Then
Me.complete = True
Else
MsgBox "Sorry I can't do that until the return date has been completed"
End If
DoCmd.Requery
End Sub
Private Sub Form_Activate()
DoCmd.Maximize
Me.Refresh
End Sub
Private Sub Command26_Click()
On Error GoTo Err_Command26_Click
Dim stDocName As String
stDocName = "Production"
DoCmd.OpenReport stDocName, acNormal
Exit_Command26_Click:
Exit Sub
Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click
End Sub
I was thinking of using a bit of code like this wraped around the whole lot above:
DoCmd.GoToRecord "TrayDetailsSub3", acNext
with a Do..While. But I just can't get this to work
Thank you in advance
Mike
Can anyone help me?
This is the code I check in each record searched:
If IsNull(Forms!production!TrayDetailsSub3!CompleteDate) Then
Me.complete = False
x = False
'MsgBox "Sorry I can't do that until you enter the Actual Return Date"
Else
'Me.complete = True
x = True
End If
If Forms!production!TrayDetailsSub3!Reworked = True And IsNull(Forms!production!TrayDetailsSub3!ReworkReturn) Then
Me.complete = False
y = False
'MsgBox "Sorry I can't do that until the job has come back from rework and date is entered in Rework Return Date"
Else
y = True
End If
If x = True And y = True Then
Me.complete = True
Else
MsgBox "Sorry I can't do that until the return date has been completed"
End If
DoCmd.Requery
End Sub
Private Sub Form_Activate()
DoCmd.Maximize
Me.Refresh
End Sub
Private Sub Command26_Click()
On Error GoTo Err_Command26_Click
Dim stDocName As String
stDocName = "Production"
DoCmd.OpenReport stDocName, acNormal
Exit_Command26_Click:
Exit Sub
Err_Command26_Click:
MsgBox Err.Description
Resume Exit_Command26_Click
End Sub
I was thinking of using a bit of code like this wraped around the whole lot above:
DoCmd.GoToRecord "TrayDetailsSub3", acNext
with a Do..While. But I just can't get this to work
Thank you in advance
Mike