473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Possible Coding Problem - Need Help

I'm having a major brain collapse on this issue. I have tried everything I can think of but it won't behave the way I want it to.

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
  1. 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]
  2. 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; 
  3.  
Expand|Select|Wrap|Line Numbers
  1. Column Count: 6; Column Widths: 0";2";1";1.5";1.7";2"; Column Heads: Yes
The from will show a related call if one is added but when the form is closed and the record looked at again the call doesn't display.

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
  1. 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]
  2. 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]))
  3. ORDER BY Calls.Address; 
  4.  
Expand|Select|Wrap|Line Numbers
  1. Column Count: 6; Column Widths: 0";2";1";1.5";1.8";1.8"; Column Heads: Yes
5. Once they find the call to relate the check the box and close the form. Then in the Call Details form it shows the information requested. Once the Call Details form is closed and opened back up to that record the information isn't there.

Now, in the "Calls" table the "Related Calls" field shows
Expand|Select|Wrap|Line Numbers
  1. SELECT Calls.[ID], Calls.Address
  2. FROM Calls
  3. ORDER BY Calls.Address;
for the "Lookup" and if a call has been related, in datasheet view you see the drop-down for all the calls with a checkbox and the call added earlier shows here checked but only the address - AND - it still doesn't display in the "Call Details" form under "Related Calls". I have tried adding all the exact same code used on the Call Details from but that didn't work either. (img_3)

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,
Attached Images
File Type: jpg img_1.jpg (50.3 KB, 146 views)
File Type: jpg img_2.jpg (60.5 KB, 127 views)
File Type: jpg img_3.jpg (55.1 KB, 158 views)
Sep 22 '16 #1
6 1052
PhilOfWalton
1,430 Expert 1GB
Much depends on your table structure, and with the correct structure all calls for a particular CustomerID and ApplianceID should automatically be displayed in a subform.

So, brief table details please

Phil
Sep 22 '16 #2
Not exactly sure what "details" you need. I can say that "Related Calls" in the table is defined as "Number" if that makes any difference.

Related Calls field:

General
Size: Long Integer
Decimal Places: Auto
Required: No
Text Align: General

Lookup
Control: Combo Box
Row Source Type: Table/Query
Row Source:
Expand|Select|Wrap|Line Numbers
  1. SELECT Calls.[ID], Calls.Address
  2. FROM Calls
  3. ORDER BY Calls.Address;
Bound Column: 1
Column Count: 2
Column Heads: No
Widths: 0";1"
List Rows: 16
With: Auto
Limit to List: Yes
Allow Multiple Values: Yes
Allow Value List Edits: Yes
Show Only Row Source Values: Yes

If you need something else let me know.

Terry
Sep 23 '16 #3
PhilOfWalton
1,430 Expert 1GB
My apologies, re-reading my post it was not very clear.

What is required are the table designs.

Plan B is to compact your databases (I assume you have a Front End & Back End), turn them both into Zip files and post them on this site or possibly send them directly to me and I will have a look.

Plan C is to a copy of your DB just have a few records and have another go at Plan B

Phil
Sep 23 '16 #4
jforbes
1,107 Expert 1GB
My guess is that after you insert a related call into your SubForm, the Multi-value field in Calls table isn't getting updated with the latest addition.

I wouldn't use Multi-Value fields unless you are publishing to a SharePoint server. Even then I would consider alternatives. Multi-value fields are nice if you don't do anything other than let Access Edit and Display the fields. Once you move beyond that, you can get odd and non-standard results.

One non-multi-value way of accomplishing this is to add a PreviousCallID field so that you can relate a Call to a Previous Call which works pretty well if there are only a limited amount of calls against something, but gets messy if there are more than three linked calls and/or you want to see all the related calls at once (unless you use SQL Server).

Another way is to create a link table to link calls to themselves in a Many-to-Many scenario. This way works well for a SubForm to list all related calls.

But the way I would recommend doing this is to implement some basic Serial Tracking. To do this create a table for your Appliances:
ApplianceID AutoNumber
CustomerID Long
SerialNumber Text
Description Text
Then add the ApplianceID to the Calls Table. Change the Related calls SubForm to link on the ApplianceID. When a Call is created, prompt for the ApplianceID, or modify the Selector you have to allow you to select calls in a batch and assign the ApplianceID.

You'll probably need a way to create new Appliance Record when entering a call against a New Appliance. For this, I would create a function that takes the CustomerID, and optionally a SerialNumber and Description, which creates a new Appliance Record and returns the ApplianceID.

The nice thing about this is that, you would then be able to create an Appliance SubForm for your Customers that would list all the Appliances that they have. You could also create a SubForm on the Customers Form that list all the Calls against that Customer.
Sep 23 '16 #5
If I had designed this DB from scratch I would have implemented a lot of changes but, since I'm working off of a pre-designed MS Access Template I didn't want to re-design it all over again.

Thanks,
Terry
Sep 23 '16 #6
I sent you a private message PhilOfWalton. I can't upload the file here. It's under 4MB, smaller that the 5MB allowed but it keeps failing.

Terry
Sep 23 '16 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
ZNip4
by: ZNip4 | last post by:
Hi this is my first time doing this so tell me if im doing anything wrong.... I just need help in creating the coding of this quiz im doing. I know so far how to load the data into the quiz by...
1
by: Benton2862 | last post by:
I need help with and array for a program that acts like a cash register. The user will input an items price and then there payment. It will tell you the change and then tell you what kinda of change...
2
by: pal | last post by:
i need help in implementing a M/M/m/m system in c++
2
by: XML Beginner | last post by:
I have an XML file that contains values that my application needs, so it knows which database to connect to. It also contains a configuration option so that I can specify which node to return...
13
by: =?Utf-8?B?TWFyaw==?= | last post by:
Need help with a variable... This variable is used to keep track of permissions and can contain 1,2,4,8,16,32,64,128 Or it can contain a sum of one more of the above values. For example, if...
1
by: flavourofbru | last post by:
Hi, I am stuck at a major part of the code in VC++. My algorithm is as follows: f_name = load(filename); //this also loads a text file. The text files contains numbers sepearted by tab....
7
by: rohitsripathi | last post by:
i need help writing this program... i am in college and i do not have time do this right now as i need to study for another test....but this is due tonight...i will pay $5 if you accept to do it and...
1
by: bazbella | last post by:
Hi I Need Help To Make A Scroll Box For My Web Page Also Need To Put Some Coding In To It Of A Banner For Poeple To Copy To Display Our Banner On There Page (my Space) Is There Some Sort Of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.