This problem, I'm hoping someone can help me out with, involves 2 forms and 1 table.
The first form (Call Details) has a tab for "Related Calls". The purpose of this is to relate calls to one another - for us showing a history of a service call for an appliance. We then group calls for the address based on the appliance being serviced, ie fridge, stove, washer, dryer, etc...
When you click the tab on Call Details it should show the related calls (if any). The problem I'm having is the display of the related calls isn't working. (img_1 shows this part)
Here is the code behind this tab: (Record Source: "Calls" table) - Calls table has a field "Related Calls" that is used for this purpose.
Expand|Select|Wrap|Line Numbers
- SELECT Calls_1.ID, Calls_1.Address AS Address, Calls_1.City AS City, Calls_1.Appliance AS Appliance, Calls_1.[Appliance Issue] AS [Appliance Issue], [Customers Name].[Customer Name] AS [Called In By]
- FROM (Calls INNER JOIN Calls AS Calls_1 ON Calls.[Related Calls].Value = Calls_1.ID) INNER JOIN [Customers Extended] AS [Customers Name] ON Calls_1.[Called In By] = [Customers Name].ID;
Expand|Select|Wrap|Line Numbers
- Column Count: 6; Column Widths: 0";2";1";1.5";1.7";2"; Column Heads: Yes
The rest of this process goes like this:
1. Pull up the record on Call Details
2. Click the "Related Calls" tab
3. Click the "Add Related Calls" button
4. A pop-up form is displayed (img_2)
a. from here the data entry person can find related calls using various criteria (all filters works)
b. they are supposed to check the box then close the form and the calls are supposed to be written to the "Related Calls" field in the table "Calls"
Here is the code for that form: (Control Source: Related Calls)
Expand|Select|Wrap|Line Numbers
- SELECT Calls.ID, Calls.Address, UCase(Calls.City) AS City, Calls.Appliance, UCase(Calls.[Appliance Issue]) AS [Appliance Issue], [Customers Name].[Customer Name] AS [Called In By]
- FROM Calls LEFT JOIN [Customers Extended] AS [Customers Name] ON Calls.[Called In By] = [Customers Name].ID WHERE (((Calls.ID)<>Form!ID) And ((Calls.Address) Like "*" & [txtAddressContains] & "*") And (([cboAssignedTo]) Is Null Or ([cboAssignedTo])=[Assigned To]) And (([cboOpenedBy]) Is Null Or ([cboOpenedBy])=[Opened By]) And (([cboStatus]) Is Null Or ([cboStatus])=[Status]) And (([cboCategory]) Is Null Or ([cboCategory])=[Category]))
- ORDER BY Calls.Address;
Expand|Select|Wrap|Line Numbers
- Column Count: 6; Column Widths: 0";2";1";1.5";1.8";1.8"; Column Heads: Yes
Now, in the "Calls" table the "Related Calls" field shows
Expand|Select|Wrap|Line Numbers
- SELECT Calls.[ID], Calls.Address
- FROM Calls
- ORDER BY Calls.Address;
I am so lost on this one I don't even know how to properly phrase the question. If I have missed something important in my code/descriptions above please don't hesitate to ask.
What I'd like displayed for related calls is shown in img_1 (which I assume must also wind up being stored as "Related Calls" in the calls table) but, as mentioned, it only shows the address in Datasheet View and does not display on the Call Details from.
If you need I can shrink the db and upload it but someone will have to help me with that. The db now has over 1,000 Customers, 100's of calls and the Employees and is just over 27MB in size.
Thanks,