ansentry
Access amateur
- Local time
- Today, 11:48
- Joined
- Jun 1, 2003
- Messages
- 995
Would someone be kind enough to tell me what I have done wrong in the code show below?
Access is give me error 3075 Syntax Error (Comma) in query and is highlighting the last line in my code.
DoCmd.Openform stDocName, , , stLinkCriteria
What I am trying to do is open a form with only the data from the previous day showing. I know I could do this in the query attached to the form, however when I (we) solve this problem, then I want to make the code open Friday, Saturday and Sunday if the current date is a Monday. The business is open 7 days a week but management will only look at the form Monday - Friday to see the previous day's deliveries.
A Command button on a "Menu form" is opening the Form.
Mydate is formatted "Long Date" in its table.
Private Sub cmdPreviousDayDeliveries_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim PrevDate As String
PrevDate = Format(DateValue(Date - 1), "Long Date")
stDocName = "Frm_PrevDayDeliveries"
stLinkCriteria = "MyDate = " & PrevDate
End SubDoCmd.Openform stDocName, , , stLinkCriteria
Access is give me error 3075 Syntax Error (Comma) in query and is highlighting the last line in my code.
DoCmd.Openform stDocName, , , stLinkCriteria
What I am trying to do is open a form with only the data from the previous day showing. I know I could do this in the query attached to the form, however when I (we) solve this problem, then I want to make the code open Friday, Saturday and Sunday if the current date is a Monday. The business is open 7 days a week but management will only look at the form Monday - Friday to see the previous day's deliveries.
A Command button on a "Menu form" is opening the Form.
Mydate is formatted "Long Date" in its table.
Private Sub cmdPreviousDayDeliveries_Click()
Dim stDocName As String
Dim stLinkCriteria As String
Dim PrevDate As String
PrevDate = Format(DateValue(Date - 1), "Long Date")
stDocName = "Frm_PrevDayDeliveries"
stLinkCriteria = "MyDate = " & PrevDate
End SubDoCmd.Openform stDocName, , , stLinkCriteria