OpenForm WhereCondition=Variable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone tell me how to open a form to show only records defined by a
variable? My code works if I type a literal number in but I can't figure out
how do it with a variable:
Dim stDocName As String
Dim stLinkCriteria As String
Dim MyVariable As Long

txtECRNumber.SetFocus
MyVariable = txtECRNumber.Text
stDocName = "subfECRTasks"

DoCmd.OpenForm stDocName, , , "ECRNumber = MyVariable"
 
Back
Top