T
Tony Williams
I have a command button on a form based on a table tblmonth, which when
clicked opens a form to show all data from one table, tblmain, where the
date input by the user, txtmontha, is the date which is in a field
txtmonthlabela, in the table tblmain. BUT I also only want the form to show
companies where the Euro indicator against the company in a compnay table,
tblcompany is set to yes. Here is my code
Private Sub Command2_Click()
On Error GoTo Command2_Click_Err
DoCmd.OpenForm "frmFDA", acNormal, "",
"[txtMonthlabela]=[Forms]![frmsterlingeurocos]![txtmontha] And
[tblCompany]![txtEuroIndicator]=Yes", acEdit, acNormal
Command2_Click_Exit:
Exit Sub
Command2_Click_Err:
MsgBox Error$
Resume Command2_Click_Exit
End Sub
The first part works in that only records for the relevant month but all the
compnaies are shown not just those where the euro indicator is set.
What am I doing wrong?
Thanks
Tony
clicked opens a form to show all data from one table, tblmain, where the
date input by the user, txtmontha, is the date which is in a field
txtmonthlabela, in the table tblmain. BUT I also only want the form to show
companies where the Euro indicator against the company in a compnay table,
tblcompany is set to yes. Here is my code
Private Sub Command2_Click()
On Error GoTo Command2_Click_Err
DoCmd.OpenForm "frmFDA", acNormal, "",
"[txtMonthlabela]=[Forms]![frmsterlingeurocos]![txtmontha] And
[tblCompany]![txtEuroIndicator]=Yes", acEdit, acNormal
Command2_Click_Exit:
Exit Sub
Command2_Click_Err:
MsgBox Error$
Resume Command2_Click_Exit
End Sub
The first part works in that only records for the relevant month but all the
compnaies are shown not just those where the euro indicator is set.
What am I doing wrong?
Thanks
Tony