G
Guest
Hello everyone,
I need your expert assistance in solving a problem I can't solve myself.
I'm in the process of building a db to replace multiple spreadsheets. One
of the tables will hold the weekly performance results of different
locations. Here's a portion the table structure:
tblPerformance
PerformanceID PK
FranchiseID FK
TheWeekID FK
LeadEnding
TheWeekID is a numeric field and on the form I have a textbox that displays
that number as a date (e.g. 38284 displays as 10/24/2004). The numbers are
in increments of 7 so the displayed date will always be a Sunday.
LeadEnding replaces one of two columns in the spreadsheet. The spreadsheet
has 'Leads From' and 'Leads To'. I designed the table with one field
figuring that 'Leads From' can be calculated. It is always the number from
the previous week's 'Leads To' plus 1.
My problem is writing the formula for the textbox that will display the
'Leads From' number. Basically, I want to lookup the LeadEnding entry in
tblPerformace where the FranchiseID matches the form's current record and the
TheWeekID is 7 less than the form's current record. This is what I have so
far.
=DLookUp(tblPerformance!LeadEnding,[tblPerformance],"[tblPerformance]![FranchiseID]="
& Forms!sfrmPerformance!txtFranchiseID And "[tblPerformance]![TheWeekID]=" &
Forms!sfrmPerformance!txtTheWeekID-7)+1
All help is appreciated.
I need your expert assistance in solving a problem I can't solve myself.
I'm in the process of building a db to replace multiple spreadsheets. One
of the tables will hold the weekly performance results of different
locations. Here's a portion the table structure:
tblPerformance
PerformanceID PK
FranchiseID FK
TheWeekID FK
LeadEnding
TheWeekID is a numeric field and on the form I have a textbox that displays
that number as a date (e.g. 38284 displays as 10/24/2004). The numbers are
in increments of 7 so the displayed date will always be a Sunday.
LeadEnding replaces one of two columns in the spreadsheet. The spreadsheet
has 'Leads From' and 'Leads To'. I designed the table with one field
figuring that 'Leads From' can be calculated. It is always the number from
the previous week's 'Leads To' plus 1.
My problem is writing the formula for the textbox that will display the
'Leads From' number. Basically, I want to lookup the LeadEnding entry in
tblPerformace where the FranchiseID matches the form's current record and the
TheWeekID is 7 less than the form's current record. This is what I have so
far.
=DLookUp(tblPerformance!LeadEnding,[tblPerformance],"[tblPerformance]![FranchiseID]="
& Forms!sfrmPerformance!txtFranchiseID And "[tblPerformance]![TheWeekID]=" &
Forms!sfrmPerformance!txtTheWeekID-7)+1
All help is appreciated.