CheapEmployerNoSQL
New member
- Local time
- Yesterday, 22:03
- Joined
- Feb 9, 2009
- Messages
- 8
So I have a form that has a text box called [SalesRep] a button when clicked runs a query from parameters entered in the form which results in a new window with a single field/record [Rep]; I have fumbled around for days trying to google a solution becasue I do not know how to get the result [REP] into the form text box name:[SalesRep] control source: [Sales Rep]
Here is the code to run the query and then the query;
Private Sub Command40_Click()
On Error Resume Next
DoCmd.OpenQuery "findrentsysrep"
DoCmd.RunCommand acCmdSaveRecord
End Sub
SELECT RentsysReps.Rep AS Rep
FROM (RentsysReps LEFT JOIN LetterAssigned ON RentsysReps.ID=LetterAssigned.RepID) LEFT JOIN StateAssigned ON RentsysReps.ID=StateAssigned.RepID
WHERE (((RentsysReps.Type)=Forms!Rentsys_CallLog.Type) And ((LetterAssigned.LetterAssignment) Like Left(Forms!Rentsys_CallLog.CompanyName,1))) Or (((StateAssigned.StateAbb) Like Forms!Rentsys_CallLog.State));
Here is the code to run the query and then the query;
Private Sub Command40_Click()
On Error Resume Next
DoCmd.OpenQuery "findrentsysrep"
DoCmd.RunCommand acCmdSaveRecord
End Sub
SELECT RentsysReps.Rep AS Rep
FROM (RentsysReps LEFT JOIN LetterAssigned ON RentsysReps.ID=LetterAssigned.RepID) LEFT JOIN StateAssigned ON RentsysReps.ID=StateAssigned.RepID
WHERE (((RentsysReps.Type)=Forms!Rentsys_CallLog.Type) And ((LetterAssigned.LetterAssignment) Like Left(Forms!Rentsys_CallLog.CompanyName,1))) Or (((StateAssigned.StateAbb) Like Forms!Rentsys_CallLog.State));