J
Joy
I posted this last week and received this very good advice but it isn't
working the way I need it to work. It works great if you
want all records, but the form must open records between a begin and end
work date. The form must return records from two tables in a one to many
relationship. One table (the parent)
stores the employee that entered the hours and WhoOwns the record, and the
second table (the child) stores the dates worked, hours etc. An unbound
form would be used to type in
the begin and end dates. I've been working on this for days. Can't believe
it's that complicated.
I created an unbound form with date criteria fields and a field called
WhoOwns with a control source of =CurrentUser.
Then tried to set the criteria to open the form (the one with the criteria
records) with a criteria string stating the following:
stLinkCriteria = "[WhoOwns]=" & Me!WhoOwns
DoCmd.OpenForm stDocName, , , stLinkCriteria
(Above - Me!WhoOwns being the control on the unbound criteria form)
The query the form is bound to has the following in the criteria field of
WorkDate: >=Forms!dlgDateRange!BeginDate AND <=Forms!dlgDateRange!EndDate
I get an error message shen I click the open form button stating "Syntax
error (missing operator) in query expression "WhoOwns = name of CurrentUser"
The current user is the name of the CurrentUser and the criteria string is
in the OnClick event of the unbound criteria form.
I've tried to do this more times than I can now count. What I doing wrong.
I hope I am explaining clearly.
Joy
working the way I need it to work. It works great if you
want all records, but the form must open records between a begin and end
work date. The form must return records from two tables in a one to many
relationship. One table (the parent)
stores the employee that entered the hours and WhoOwns the record, and the
second table (the child) stores the dates worked, hours etc. An unbound
form would be used to type in
the begin and end dates. I've been working on this for days. Can't believe
it's that complicated.
I created an unbound form with date criteria fields and a field called
WhoOwns with a control source of =CurrentUser.
Then tried to set the criteria to open the form (the one with the criteria
records) with a criteria string stating the following:
stLinkCriteria = "[WhoOwns]=" & Me!WhoOwns
DoCmd.OpenForm stDocName, , , stLinkCriteria
(Above - Me!WhoOwns being the control on the unbound criteria form)
The query the form is bound to has the following in the criteria field of
WorkDate: >=Forms!dlgDateRange!BeginDate AND <=Forms!dlgDateRange!EndDate
I get an error message shen I click the open form button stating "Syntax
error (missing operator) in query expression "WhoOwns = name of CurrentUser"
The current user is the name of the CurrentUser and the criteria string is
in the OnClick event of the unbound criteria form.
I've tried to do this more times than I can now count. What I doing wrong.
I hope I am explaining clearly.
Joy