G
Guest
Is it possible to use a between statement on a date field, and getting the 2
dates by selecting them in a form? I have tried to do this with the
following code/Query:
Query:
SELECT tblExpenses.Date, tblExpenses.Store, tblExpenses.Type,
tblExpenses.Category, tblExpenses.[Trip/Location], tblExpenses.Description,
tblCreditCards.Bank
FROM tblCreditCards INNER JOIN tblExpenses ON tblCreditCards.[Card Number] =
tblExpenses.[Credit Card]
WHERE (((tblExpenses.Date) Between [Forms]![frmstatement]![cboStartDate ]
And [Forms]![frmstatement]![cboEndDate]) AND
((tblExpenses.Type)="Reimbursements") AND ((tblCreditCards.Bank)="American
Express"));
Code on the form:
Private Sub Command8_Click()
DoCmd.OpenQuery "QryReimbursementsAmericanExpressCBO", acViewNormal, acEdit
DoCmd.Close acForm, "frmstatment"
End Sub
but I keep getting this error:
The expression On Click you entered as the event property setting produced
the follwoing error: A problem occured while Microsoft Access was
communicating with the OLE server or ActiveX Control.
Any suggestions?
dates by selecting them in a form? I have tried to do this with the
following code/Query:
Query:
SELECT tblExpenses.Date, tblExpenses.Store, tblExpenses.Type,
tblExpenses.Category, tblExpenses.[Trip/Location], tblExpenses.Description,
tblCreditCards.Bank
FROM tblCreditCards INNER JOIN tblExpenses ON tblCreditCards.[Card Number] =
tblExpenses.[Credit Card]
WHERE (((tblExpenses.Date) Between [Forms]![frmstatement]![cboStartDate ]
And [Forms]![frmstatement]![cboEndDate]) AND
((tblExpenses.Type)="Reimbursements") AND ((tblCreditCards.Bank)="American
Express"));
Code on the form:
Private Sub Command8_Click()
DoCmd.OpenQuery "QryReimbursementsAmericanExpressCBO", acViewNormal, acEdit
DoCmd.Close acForm, "frmstatment"
End Sub
but I keep getting this error:
The expression On Click you entered as the event property setting produced
the follwoing error: A problem occured while Microsoft Access was
communicating with the OLE server or ActiveX Control.
Any suggestions?