Just to explain it better:
in a module put this:
VB Code:
Public sCrit1 As String
Public sCrit2 As String
Public sCrit3 As String
Public Function GetCrit1() As String
GetCrit = sCrit1
End Function
Public Function GetCrit2() As String
GetCrit = sCrit2
End Function
Public Function GetCrit3() As String
GetCrit = sCrit3
End Function
THen in your form set the variables before its called...
VB Code:
Private Sub Command40_Click()
[B] sCrit1 = "a"
sCrit2 = "b"
sCrit3 = "c"[/B]
On Error GoTo Err_Command40_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim intHolder As Integer
intHolder = DCount("UnitAreaName", "qryMainDue")
If intHolder > 0 Then
stDocName = "frmDue"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "There are no records!"
End If
Exit_Command40_Click:
Exit Sub
Err_Command40_Click:
MsgBox Err.Description
Resume Exit_Command40_Click
End Sub
then u can use
GetCrit1()
GetCrit2()
GetCrit3()
in the criteria fields