Credit to Davegri for this solution!
No sure if this would help but...
Variable Define:
[Input Date] = Field on main form that controls records show on sub forms.
[Daily Input Report] = Main Form name
This is designed for dates but it might help with your need... also see code below for a VBA option that uses the nav buttons to update.
without VBA you could use:
If(isnull([Input Date],*select*From[Daily Input Report]","Select*From[Daily Input Report]Where[Input Date]=#"&[Input Date]&"#")
VBA Code:
Code:
Option Compare Database
Option Explicit
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
If DCount("*", "[Daily Input Report]", "[Input Date]=" & Date) = 0 Then
DoCmd.GoToRecord , , acNewRec
End If
End Sub
Private Sub NavigationButton21_Click()
If IsNull(Me.[Input Date]) Then
Else
Me.NavigationSubform.Form.RecordSource = "Select * from [Daily Input Report] Where [Input Date] = #" & Me.[Input Date] & "#"
End If
End Sub
Private Sub NavigationButton25_Click()
If IsNull(Me.[Input Date]) Then
Else
Me.NavigationSubform.Form.RecordSource = "Select * from [Daily Input Report] Where [Input Date] = #" & Me.[Input Date] & "#"
End If
End Sub