What is it you need help with? Do you want this code explained?
Static StrWorkerID As String
Static LgCaseNum As Integer
These create 2 variables that will remember their value each time you enter
the routine, as long as the form remains open. This is done by using the
Static keyword instead of Dim.
If Me.NewRecord Then
Me.WorkerID = [Forms]![FrmEditCase]![SubformCase].[Form]![WorkerID]
Me.Text78 = [Forms]![FrmCaseSearch].[CaseNoBox]
End If
The Current event runs each time the form goes to a different record,
including moving to the first record as the form opens and when moving to a
new record when you want to add another record. The If statement here checks
to see if you are at a new record and if you are, then assign the values
from the forms FrmEditCase (actually from a control on a subform of
FrmEditCase) and FrmCaseSearch to the controls on this form. These other two
forms must be open at the time the code runs in order for this to work.
--
Wayne Morgan
MS Access MVP
MN said:
Please help with this code:
Private Sub Form_Current()
Static StrWorkerID As String
Static LgCaseNum As Integer
If Me.NewRecord Then
Me.WorkerID = [Forms]![FrmEditCase]![SubformCase].[Form]![WorkerID]
Me.Text78 = [Forms]![FrmCaseSearch].[CaseNoBox]
End If
End Sub