hi guys -the code (all capital letters) generates daily packing number,
it is in the on click event of a command button that moves to the next
record.
dpkn is unbound control - i use it to display the last daily packing
number genrated, so when the user moves to a new control they will know
what the last daily packing number was.
PdailyPackingNumber is bound and is 0 until the user clicks the button.
Private Sub CBfrmPackingSubPacked_Click()
On Error GoTo Err_CBfrmPackingSubPacked_Click
Dim x As Byte
X = NZ(DPKN, 0) + 1
If Nz(Plenght, 0) = 0 Or Nz(Pwidth, 0) = 0 Or Nz(Phight, 0) = 0 Or
Nz(Pweight, 0) = 0 Then
MsgBox "You Must Enter All Package Dimensions in Order to Continue",
vbOKOnly
Plenght.SetFocus
Else
Packed = True
PDAILYPACKINGNUMBER = x
DPKN = PDAILYPACKINGNUMBER
End If
DoCmd.GoToRecord , , acNext
PdailyPackingNumber.Requery
Exit_CBfrmPackingSubPacked_Click:
Exit Sub
Err_CBfrmPackingSubPacked_Click:
MsgBox Err.Description
Resume Exit_CBfrmPackingSubPacked_Click
End Sub
everything works great until i exit the form - when i come back dpkn is
0
i know why this is hapening - what would the best way to fix this?
and is there a better way of doing what i have done so far?
also, is there a way to open a form and automatically go to the record
that was active when i closed the form?
thank you all for all your help