R
Renee
I am trying to prefill two fields on a subform, if it is a new record. Here
is what I used:
Private Sub Form_Current()
If Me.NewRecord = True Then
Dim varWeek As Variant
varWeek = DLookup("Max[Week#]", "Orders", "[EmpID] =" & Me.Parent.[EmpID])
Me.EmpID = Me.Parent.EmpID
Me.[Week#] = varWeek + 1
End If
End Sub
The subform fills based on the employee selection on the main form. When I
try to add a new record, I get the following error:
Microsoft Access can't find the field '|' referred to in your expression
Any suggestions would be great!
Thank you,
Renee
is what I used:
Private Sub Form_Current()
If Me.NewRecord = True Then
Dim varWeek As Variant
varWeek = DLookup("Max[Week#]", "Orders", "[EmpID] =" & Me.Parent.[EmpID])
Me.EmpID = Me.Parent.EmpID
Me.[Week#] = varWeek + 1
End If
End Sub
The subform fills based on the employee selection on the main form. When I
try to add a new record, I get the following error:
Microsoft Access can't find the field '|' referred to in your expression
Any suggestions would be great!
Thank you,
Renee