bigmaxnosauce
Registered User.
- Local time
- Today, 17:44
- Joined
- Nov 14, 2002
- Messages
- 12
I have a form with command buttons, each button opens a specific agent's orders. Each Agent has an assigned territory. The orders are based on Name, because one can place an order for a territory other than their own. Here's the code I have,
stLinkCriteria = "[RepName]= 'Agent's Name'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "Switch", acSaveYes
which works. What I'm having trouble with is replacing 'Agent's Name' with a variable that would ID the RepName by the corresponding territory. Please help I'm not sure I have made my problem completely clear.
Thanks
stLinkCriteria = "[RepName]= 'Agent's Name'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "Switch", acSaveYes
which works. What I'm having trouble with is replacing 'Agent's Name' with a variable that would ID the RepName by the corresponding territory. Please help I'm not sure I have made my problem completely clear.
Thanks