I have a combo box named Account on a subform named RFP Expenses subform. That subform is on a main form named RFP Entry. There is a text box on RFP Entry named Account_To_Be_Charged. The main form and subform are linked via a field named RFP_Number. For each record created in the subform, I select an Account from the Account combo box. These numbers can be 1, 2, 4, 6, 7, or 8. For each RFP, I may create a number of expense records in the subform that use just one of those Account numbers or several. For example:
Doctor# Expense Code Acct Amt
101 3000 1 30.00
102 3001 4 15.00
103 3000 4 7.50
103 3002 7 50.00
Or like this:
Doctor# Expense Code Acct Amt
101 3000 1 30.00
102 3001 1 15.00
102 3001 1 20.00
In the Accounts table, we have:
Account_ID Account_Description
1 Operations
2 Professional Development
4 Operations
6 Operations
7 Professional Enrichment
8 Incentive/Development
What I would like to do is have the text box named Account_To_Be_Charged on the main form lookup the Account_Descriptions for the Account #s entered for the records in the subform. If there is only one Account # used then the Account_To_Be_Charged box would just display that Account's description. If there is more than one different Account number entered in the set of records in the subform for that particular RFP record displayed in the main form, then each Account's description should be strung together with slash characters in between. For example:
Operations / Professional Enrichment (for acct #s 1 and 7 or 4 and 7 or 6 and 7)
Or
Operations for acct #s 1, 4, or 6
Or
Professional Development / Division Incentive (for acct #s 2 and 8)
If Account #s 1, 4, or 6 occur together in the same set of records in the subform, then "Operations" should only print once in the Account_To_Be_Charged text box. So, if there are some records for acct #s 1, 2, 6, and 7 in the subform for that particular RFP main form record, then the Account_To_Be_Charged text box should say:
Operations / Professional Development / Professional Enrichment
I think I may have to use a DLookup to look up the Account_Description, and I think I may have to create an expression for the control source of the Account_To_Be_Charged text box that uses the & symbol to string the descriptions together with the slash characters. But, other than that, I'm not sure how to proceed.
Should you have any questions or require additional information, please let me know.
Thanks for your input,
Michael
Doctor# Expense Code Acct Amt
101 3000 1 30.00
102 3001 4 15.00
103 3000 4 7.50
103 3002 7 50.00
Or like this:
Doctor# Expense Code Acct Amt
101 3000 1 30.00
102 3001 1 15.00
102 3001 1 20.00
In the Accounts table, we have:
Account_ID Account_Description
1 Operations
2 Professional Development
4 Operations
6 Operations
7 Professional Enrichment
8 Incentive/Development
What I would like to do is have the text box named Account_To_Be_Charged on the main form lookup the Account_Descriptions for the Account #s entered for the records in the subform. If there is only one Account # used then the Account_To_Be_Charged box would just display that Account's description. If there is more than one different Account number entered in the set of records in the subform for that particular RFP record displayed in the main form, then each Account's description should be strung together with slash characters in between. For example:
Operations / Professional Enrichment (for acct #s 1 and 7 or 4 and 7 or 6 and 7)
Or
Operations for acct #s 1, 4, or 6
Or
Professional Development / Division Incentive (for acct #s 2 and 8)
If Account #s 1, 4, or 6 occur together in the same set of records in the subform, then "Operations" should only print once in the Account_To_Be_Charged text box. So, if there are some records for acct #s 1, 2, 6, and 7 in the subform for that particular RFP main form record, then the Account_To_Be_Charged text box should say:
Operations / Professional Development / Professional Enrichment
I think I may have to use a DLookup to look up the Account_Description, and I think I may have to create an expression for the control source of the Account_To_Be_Charged text box that uses the & symbol to string the descriptions together with the slash characters. But, other than that, I'm not sure how to proceed.
Should you have any questions or require additional information, please let me know.
Thanks for your input,
Michael