473,503 Members | 3,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to link two subforms results in non-stop flickering of the form?

8 New Member
Hello,
I have been trying to resolve this problem for a while and can't seem to find a solution anywhere.

I have a database with the following relationship setup: A) Contract table with field AssetID (AutoNumber) linked to table LineItems (One to many relationship). B) LineItems table with field LineItemID (AutoNumber) linked to two tables 1) LineItemsExpenseDetails (One to many relationship) and 2) LineItemsPaymentDetails (One to many relationship). The logic is that one contract can have multiple line items and each line item can have multiple expense and multiple payments. Not sure if the relationship optimally setup.

Created three datasheet subforms: 1) sfrmLineItems bound to table LineItems 2) sfrmLineItems bound to table LineItemsExpenseDetails and 3) sfrmPayments bound to table LineItemsPaymentDetails

Created a form to pull it all together as follows: An unbound text box to select the contract to view. Inserted sfrmLineItems to enter the multiple line items related to the selected contract. Next I inserted a Tab Control and named the first page "Expenses" and inserted the subform "LineItemsExpenseDetails". The second page I named "Payments" and inserted the subform "LineItemsPaymentDetails".

For a while could not get the expense and payment subform to link to the first LineItem subform's line item number. I read about a solution where you would insert an unbound text box in the Master subform and reference the field that is to be used as the link. In the subform that needs to be updated, reference the Name assigned to this unbound text box. This seemed to work ok for the Expense subform but when applied to the Payment subform and I previewed the form, it flickered uncontrollably. Can't seem to find a solution to this flickering or an alternate database setup solution. Your help is deeply appreciated.
Thanks in advance,
CJ
Jan 22 '11 #1
10 2440
ADezii
8,834 Recognized Expert Expert
This is one of those questions, at least for me, that is impossible to answer without having the physical Database in front of me.
Jan 22 '11 #2
CJ Jarvis
8 New Member
ADezii -
Thanks for your quick response. I have attached the database for your review.
CJ
Attached Files
File Type: zip CJ_Contracts_New.zip (237.1 KB, 122 views)
Jan 22 '11 #3
ADezii
8,834 Recognized Expert Expert
Give me a little time, and when I get a chance, I'll have a good look at it.
Jan 22 '11 #4
ADezii
8,834 Recognized Expert Expert
CJ, before I can look at this DB in ernest, I must make sure that we are talking about the same DB.
A) Contract table with field AssetID (AutoNumber) linked to table LineItems (One to many relationship),
There is no [AssetID] Field in the Contracts Table (not Contract). There is a [ContractNumber] Field linked to the LineItems Table but also to an Assets Table.
B) LineItems table with field LineItemID (AutoNumber) linked to two tables 1) LineItemsExpenseDetails (One to many relationship) and 2) LineItemsPaymentDetails (One to many relationship).
There is no [LineItemID] Field in the LineItems Table, but a [LineItemNumber] Field. The LineItemsExpenseDetails and LineItemsPaymentDetails Tables do not even exist.

P.S. - You must be more detailed as to the information that you are providing, and to which is reflected in your Attachment.
Jan 22 '11 #5
CJ Jarvis
8 New Member
Good catch Dezii. You are absolutely correct. For your referenced (A) it was a typo error (guessing from lack of sleep trying to resolve and complete this database and hopefully not me losing my sanity). It should have been ContractNumber instead of AssetID; and for (B) I had redesigned and added to the database and submitted the newer version. Attached is the older one that should hopefully correspond with my original submission. My apologies for this. Please reference below for full details:
...............................

I have been trying to resolve this problem for a while and can't seem to find a solution anywhere.

I have a database with the following relationship setup: A) Contract table with field ContractNumber(AutoNumber) linked to table LineItems (One to many relationship). B) LineItems table with field LineItemID (AutoNumber) linked to two tables 1) LineItemsExpenseDetails (One to many relationship) and 2) LineItemsPaymentDetails (One to many relationship). The logic is that one contract can have multiple line items and each line item can have multiple expense and multiple payments. Not sure if the relationship optimally setup.

Created three datasheet subforms: 1) sfrmLineItems bound to table LineItems 2) sfrmLineItemsExpenseDetails bound to table LineItemsExpenseDetails and 3) sfrmLineItemsPaymentDetails bound to table LineItemsPaymentDetails

Created a form, frmContractsAccounting (data source is the Contract table), to pull it all together as follows: An unbound text box to select the contract to view. Inserted sfrmLineItems to enter the multiple line items related to the selected contract. Next I inserted a Tab Control and named the first page "Expenses" and inserted the subform "LineItemsExpenseDetails". The second page I named "Payments" and inserted the subform "LineItemsPaymentDetails".

For a while could not get the expense and payment subforms to link to the first LineItem subform's line item number. I read about a solution where you would insert an unbound text box in the Master subform and reference the field that is to be used as the link. In the subform that needs to be updated, reference the Name assigned to this unbound text box. This seemed to work ok for the Expense subform but when applied to the Payment subform and I previewed the form, it flickered uncontrollably. Can't seem to find a solution to this flickering or an alternate database setup solution. Your help is deeply appreciated.
Thanks in advance,
CJ
Attached Files
File Type: zip CJ_Contract_v2.zip (234.1 KB, 94 views)
Jan 22 '11 #6
ADezii
8,834 Recognized Expert Expert
@CJ - I tried to arrive at a solution which keeps your existing Table Structures, Relationships and Forms in tact. I feel as though I have partially accomplished this by:
  1. Using the Main Form (Contact) in the context that it was originally.
  2. Creating a true Sub-Form (LineItems) Linked directly to the Main Form (Contact).
  3. Creating two, independent Forms (Payment and Expense Details) dynamically Linked to LineItems.
  4. Keeping all Forms visible on the Main Form itself.
  5. Auto Display of Contract Names along with their Start and End Dates.
  6. Independent Find Contract capability.
  7. Download the Attachment, paying particular attention to the Link Child/Master Field Properties as well as the Current() Event of the LineItems Form.
Attached Files
File Type: zip CJ_Contract_New_2.zip (232.4 KB, 114 views)
Jan 23 '11 #7
CJ Jarvis
8 New Member
Wow Dezii..you are awesome. I don't think that I can thank you enough. Your coding and database design is commendably efficient and much cleaner than my submitted version. Thanks for taking the time. I very much appreciate it and have definitely learnt something new today.

I guess my next hurdle is to try to filter the form then push reports out from this. I was looking at ways to accomplish this and my initial thought is to attempt creating a front page form to enter the Start Period, Start Year, End Period, and End Year and thereby forcing the contract form to show only data for that period/year range; then use that data to create reports summarizing the filtered data (summarized periods in the columns and summarized years expense and payments for the rows) . Is this a structure that you think is plausible? I am currently searching the threads to find anything close that could give me an idea how to accomplish this great feat (at least to a novice like me).
Thanks,
CJ
Jan 23 '11 #8
ADezii
8,834 Recognized Expert Expert
I would imagine that you primarily need a Form dedicated to entering Contract Information only, given the varied number of Fields contained within.
Jan 24 '11 #9
CJ Jarvis
8 New Member
Yes, the form in the submitted database is dedicated to entering Contract information only. I created several forms so far: 1) a form to enter the contract main details and hyperlink copies of the contracts on my hard drive for viewing 2) a form to select the contract entered and update the expense and payments. I managed to put together a code (testing its accuracy now) that calculates the periods and the amounts to expense and write this to the expense table instead of entering it manually. Payments will be entered manually.

After all is said and done I have to output an amortization schedule like the below:

P1 P2 P3 ... Full Year
2011 Expenses $20 $10 $5 ... $35
2011 Payments $10
Total Prepaid/(Accrual)

2012 Expenses $20 $10 $5 ... $35
2012 Payments $10
Total Prepaid/(Accrual)

On the top I was thinking that I enter various fields from the actual contract (Contract Name, Counterparty Name, Contract Start Date, Contract End Date, Category...) and filter the data according to what is selected or show all if nothing is selected.

Yes, I know that its a big task and being an aging accountant trying to jump into database design leaves me at a disadvantage.
Thanks,
CJ
Jan 24 '11 #10
ADezii
8,834 Recognized Expert Expert
Sounds like you need a Criteria Form listing several Fields that will actually Filter the Data for your Main Form.
Jan 24 '11 #11

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

Similar topics

20
3197
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
5
1594
by: Rudy | last post by:
I am desperately seeking some help with a program that was supposed to have been completed last night. I have only been working with PHP for a week. I have tried and tried and tried, but I am...
14
2931
by: diskoduro | last post by:
Hi!! Years ago I built a database to control the production of a little factory. The users wanted to work in a Windows Net workgroup so I created an mdb with all the tables and data an after...
8
3062
by: Zlatko Matić | last post by:
Hello. How can I synchronize subforms content with current record in master form, if both form and subform are based on DAO code ? I assigned DAO recordset to forms by using QueryDef, on Load...
5
3048
by: kkrizl | last post by:
I have a form that shows burglar alarm permits. I have a subform that shows the alarms that have occurred at the location of the permit (linked by permit number). There is a different fine schedule...
2
1388
by: Deenos2000 | last post by:
The database has 3 subforms. Within one subform donors are put into one of two categories. In another subform the amount of their donations is entered. What is the most efficient way to set it up...
3
5084
by: Charles Nicholson | last post by:
Hello all- I have some static C++ libraries that I wrote in VS2003 but which upgraded fine when i went to VS2005 Pro. In them i overload the global versions of operators new, new, delete, and...
7
12280
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
3
2578
by: 6afraidbecause789 | last post by:
Think school - students - discipline interventions - misbehaviors - staff for this one....On a mainform frmStudentInterventions, I have linked a subform (sfrmMisbehaviors) with another subform...
10
2161
kiseitai2
by: kiseitai2 | last post by:
Hi everyone. My problem is tha Dev-C++ compiles perfectly fine but it fails in the linking process. I receive the linker error "multiple definitions of"; howerver, I modified the names of the...
0
7192
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
7064
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7261
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,...
0
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.