I'm working from MS Access "Call Tracker" template and I need some help.
What I'm Using:
MICROSOFT OFFICE 365
ACCESS 2016 MSO (16.0.6965.2053 ) 32-bit
On the form "Call Details" I need to add two extra fields (4 total but the other two are simple text fileds): Under "Called In By" I need to add "Called In By Phone" and "Bill To" both of which are stored in both "Customers" and "Customers Extended" tables - [Customers Extended] is the SQL for the combo box source. The source for the form is [Calls].
These three fields: [Called In By], [Called In by Phone], and [Bill To] I need to operate as one - meaning when a caller is selected the other two fields are populated automatically.
I did manage to get the two boxes pre-filled using the code below but it does not use any IF logic. I'm not sure where to put the IF logic - here in the VBA or in the SELECT statement for the cbobox (shown below).
Here is the full scenario:
Customer calls in, employee taking the phone call clicks on the [cboCalledInBy] and selects a name from the list. I want the two remaining fields ([txtCalledInByPh one] & [txtBillTo]) to be filled in automatically but with IF logic.
If the person selected has a [Mobile Phone] entry in their record then [txtCalledInByPh one] should use that if not then use [Business Phone] and if both are blank then return empty. Then for the "Bill To" if the record selected as [cboCalledInBy] has a [Company] name then [txtBillTo] should fill in with it but if they don't I want it to fill in with the callers name that was first selected [cboCalledInBy].
The other two boxes are just text boxes for a Tenant Name and Number, nothing special for them.
The SELECT statement for the [cboCalledInBy] filed is:
This raises the question: Customer Name becomes column 1, Company becomes column 2, Business Phone becomes column 3 and Mobile Phone becomes column 4. These are used in the VBA code shown above.
I suspect that the IF logic would have to be done on the STATEMENT so the column numbers in the VBA would be correct, I think?
The more I look for ways to accomplish this, the more I am lost.
Please Help!
Terry Echols
What I'm Using:
MICROSOFT OFFICE 365
ACCESS 2016 MSO (16.0.6965.2053 ) 32-bit
On the form "Call Details" I need to add two extra fields (4 total but the other two are simple text fileds): Under "Called In By" I need to add "Called In By Phone" and "Bill To" both of which are stored in both "Customers" and "Customers Extended" tables - [Customers Extended] is the SQL for the combo box source. The source for the form is [Calls].
These three fields: [Called In By], [Called In by Phone], and [Bill To] I need to operate as one - meaning when a caller is selected the other two fields are populated automatically.
I did manage to get the two boxes pre-filled using the code below but it does not use any IF logic. I'm not sure where to put the IF logic - here in the VBA or in the SELECT statement for the cbobox (shown below).
Code:
Private Sub cboCalledInBy_AfterUpdate() Me.txtCalledInByPhone = Me![cboCalledInBy].Column(3) Me.txtBillTo = Me![cboCalledInBy].Column(2) End Sub
Customer calls in, employee taking the phone call clicks on the [cboCalledInBy] and selects a name from the list. I want the two remaining fields ([txtCalledInByPh one] & [txtBillTo]) to be filled in automatically but with IF logic.
If the person selected has a [Mobile Phone] entry in their record then [txtCalledInByPh one] should use that if not then use [Business Phone] and if both are blank then return empty. Then for the "Bill To" if the record selected as [cboCalledInBy] has a [Company] name then [txtBillTo] should fill in with it but if they don't I want it to fill in with the callers name that was first selected [cboCalledInBy].
The other two boxes are just text boxes for a Tenant Name and Number, nothing special for them.
The SELECT statement for the [cboCalledInBy] filed is:
Code:
SELECT [ID], [Customer Name], [Company], [Business Phone], [Mobile Phone] FROM [Customers Extended] ORDER BY [Company];
I suspect that the IF logic would have to be done on the STATEMENT so the column numbers in the VBA would be correct, I think?
The more I look for ways to accomplish this, the more I am lost.
Please Help!
Terry Echols
Comment