It's very simple code, really.
From the control on the search form:
- Private Sub memLast_Click()
-
On Error GoTo Err_memLast_Click
-
-
Dim stDocName As String
-
Dim stLinkCriteria As String
-
-
stLinkCriteria = "hhId=" & Me.hhId
-
DoCmd.OpenForm "frmHousehold", , , stLinkCriteria
-
-
-
Exit_memLast_Click:
-
Exit Sub
-
-
Err_memLast_Click:
-
MsgBox Err.Description
-
Resume Exit_memLast_Click
-
-
End Sub
And from the intake form:
- Private Sub Form_Current()
-
Dim monthCount, yearCount As Integer
-
-
monthCount = Me![sfrmHiddenFBMonthCount].[Form]![txtFBCount]
-
If monthCount > 1 Then
-
Label34.Visible = False
-
txtBoxesThisMonth.Visible = False
-
Label35.Visible = False
-
lblExceededMonthLimit.Visible = True
-
End If
-
-
yearCount = Me![sfrmFoodbox].[Form]![txtFBCount]
-
If yearCount > 11 Then
-
Label31.Visible = False
-
txtBoxesThisYear.Visible = False
-
Label32.Visible = False
-
lblExceededAnnualLimit.Visible = True
-
End If
-
End Sub
I tried moving it to other events, but got the same results no matter where I put it. Is it because I'm relying on a value from the subform?