Main And Secondary Forms
Oct 9, 2006
Hi
I have a main table in my database. For each record in this table there may exist 0, 1 or many records linked to it in a secondary table.
I have created a form for viewing the records in the main table, and now want to link to a second form that displays the records in the secondary table, if indeed any exist for the main record being displayed on form1.
Specifically . .
If I can detect whether secondary records exist for each record in the first, how can I pass a parameter (ie Table1id) to the secondary form so that we can view only the secondary records associated with the main record selected ?
thanks
ajm
View Replies
ADVERTISEMENT
May 14, 2014
I built an Append Query to take records of 'Leavers' from my Primary Table and add them to a Secondary Table named 'Leavers. This worked perfectly, but on reflection I determined that I needed to append a further column 'Notes' which exists in the Main Table but not in the Secondary Table.I amended the SQL statement as follows, but the query now fails stating that it doesn't recognize the field 'Notes'.
INSERT INTO Leavers ( [Member ID], Surname, [First Name], [Address 1], [Address 2], Town, PostCode, Phone, [E-Mail], Notes )
SELECT [Mail List].[Member ID], [Mail List].Surname, [Mail List].[First Name], [Mail List].[Address 1], [Mail List].[Address 2], [Mail List].Town, [Mail List].PostCode, [Mail List].Phone, [Mail List].[E-Mail], [Mail List].Notes
FROM [Mail List]
WHERE ((([Mail List].Leaving)=True));
Does this mean that one would need to recreate a new Secondary Table to incorporate the additional field? I have attempted to edit the secondary table by merely adding the 'Notes' field but that doesn't seem to be possible.
View 3 Replies
View Related
Oct 11, 2004
Hello
I have this problem. I've made a table called "producers" and a main form based on this table. I've also made a table called "orders", with several data regarding orders, and a secondary table based on the "orders" table. These tables are linked. So these forms show the orders made by each producers. Now , I try to add the "price" field of each record of the secondary form and then show the result in a text box in the main form, so that I can have a total price amound for each producer.I've tried many things but nothing seems to work. Is this so difficult to achieve? Pls help. Thank you in advance!
View 14 Replies
View Related
Apr 17, 2013
I have a form where I am entering orders. For this, there is only 1 item and 1 customer per order. The Order_Table is the 'general' of the form. However, I want a Customer_name dropdown on the form, and return data to 'display' on the form (but capturing and ONLY storing the Customer_no), once the user makes a selection.
Additionally, in the same vein, I want to have an Item_name list, where the user selects one from the listing, and display (again, no edit) the name. Again, only want to store the Customer & Item numbers on the Order table.Here's the 'general' table layout (I've taken out what doesn't matter):
Table: Order_Table
Order_no
Customer_no
Item_no
Table: Customer_Table
Customer_no
Customer_name
Table: Item_Table
Item_no
Item_name
View 1 Replies
View Related
Jan 23, 2006
Hey everyone,
Is there any way that you can do a secondary sort on a field?
Any help would be of great!
Thanks - edawson
View 2 Replies
View Related
Mar 15, 2005
The main form (frmMain) is fed by qryMain. I'd like to put a memo field on a separate form (frmMemoField) to avoid cluttering the main form.
Is there a way to ensure that frmMemoField offers the same record currently displayed on frmMain, please, Experts?
View 2 Replies
View Related
Apr 25, 2006
Afternoon all,
ac2003
I have a problem concerning how to display records dependant or depending on the current record.
Basically I have a seperate area within the db that gives you the option to set which record(s) depends on or dependant to another record(s) as primary and secondary
When trying to display this info, it is fine for a direct primary - secondary within my listbox, but the complication occurs when the secondary record could also be a primary record of another record (if that makes sense).
for example. The data is as such,
PrimaryID SecondaryID
10 12
12 13
15 10
So from this data, my list box should show 1 record that this record depends on (15) , and in another list box 2 records than depend on this record (12,13)
I'm wondering if some kind of loop code would do the trick but not sure what angle to attack this at.
I would appreciate it if anyone knows a simple solution to this.
Thanks
Kempes.
View 13 Replies
View Related
Feb 17, 2005
Hello
I have a form that is bound to a table called "date". Date has to fields "date_id" which is a numeric value and "date_description" which is the name of the month.
A secondary form is bound to a table called "Employees" which has fields regarding data about the emploees of a company (eg "surname", name" etc). I use these 2 formes together to select the month of year and show/edit the data of the employees. Everything work perfectly except one last thing. Is it possible that after I edit (or add) a record in the secondary form (table "employees") the secondaty form to be sorted by "surname"? How can I do such a thing? I would be grateful if you give me an example.
Thank you in advance
View 6 Replies
View Related
Oct 27, 2014
I have an Access database, where one of the tables is near the maximum amount of fields (241 of 255), was just wondering if I could set up a secondary table that would be linked to the original table by a specific field and would store the other fields that would like to add to the table.
View 7 Replies
View Related
Aug 16, 2014
Imagine you have a split database with two users making reports on their own front end. Lets say user 1 wants to share a report they built with user 2. is it possible to send this Object through vba so that user 2 would received a working editable copy that they can use on their front end without sharing the actual accdb front ends?
I thought about creating a Database that would just host the reports but again if I cannot send or access secondary database objects then this method would not work.
View 3 Replies
View Related
Jun 13, 2006
Hi
I have three figures to display in a chart.
The Total Ongoing Calls
The Ongoing Calls in Area 1
The Ongoing Calls in Area 2
Ideally the Total Ongoing Calls should equal the other two but this is never the case due to calls in wrongs areas etc. To display this I have the Total Ongoing Calls shown as an Area Chart on the Primary Axis with the other two figures shown as a Stacked Area Chart on the Secondary Axis.
This way if I manually fix the Primary and Secondary Axis Scale to the same then I can see at a glance the total in both areas and the discrepancy from the Total. Great.
The issue is that the Primary Axis will almost always be slightly higher than the Secondary Axis which means that whenever the Scale changes I would have to manually change the other Axis. Is there any way, programaticallly or otherwise, that I can link the two Axis together so that if one changes up or down the other changes with it.
Thanking everyone I am about to confuse in advance.
JC
View 1 Replies
View Related
Sep 24, 2005
Hi,
I can't seem to get this right...any help much appreciated:
I have a two tables LESSON<PAYMENT (One to Many)
LESSON
Lesson_ID (PK autonumber)
Lesson_Date (Date)
PAYMENT
Payment_ID (PK autonumber)
Lesson_ID (FK)
Payment_Date (Date)
I am maintaining LESSON using a simple form. On creating each new LESSON record, I also wish to insert a row into PAYMENT, using values from the LESSON table - Payment_ID(autonumber), Lesson_ID = LESSON.Lesson_ID, Payment_Date = LESSON.Lesson_Date
What is the best way to do this?
I have tried to add an Event Procedure to 'Before Insert' but I can't seem to get the syntax correct. Also, for this to work, do I need to paint all fields on LESSON form including (hidden) PK?
I have simplified the tables above but they are relevant to what I am trying to do. Any help would be much appreciated- am new to Access...rather frustrating.
Many thanks,
Simon.
PS I have searched through existing messages but can't see one that answers this, I apologise if this has been answered before- just point me to the orig post.
View 2 Replies
View Related
Mar 9, 2006
Hi all, don't know if this is possible, but right now I'm running a query and then performing Dmin/Dmax on each record in the recordset and it's running SLOOOOW. Perhaps if I can get it from a query it would be faster.
I have Table-A and Table-B with a one to many relationship. In the Table-A I preferably need to return only one row per record. From Table-B, I need to return the minimum and maximum record that corresponds to the ID in Table-A.
I am familiar with min and max, but it the join methods I've been using either return multiple rows per ID or none. Any way around this?
View 2 Replies
View Related
Nov 12, 2013
I have a command button that basically saves the record that i just finished entering. here's the code:
Private Sub cmdAddAnother_Click()
On Error GoTo Err_cmdAddAnother_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Exit_cmdAddAnother_Click:
[Code] ....
What I'd like to do now is add a second function that will make all the controls on the form go to null after the record is saved. so the user can start from scratch and add another record.
I tried adding me.refresh right before "end sub" but that didnt work.
I tried adding "me.controlname.value = null" for every control on the form, and that didnt work either.
I also tried adding this code that i found on bytes.com:
On Error Resume Next
Dim ctl As Control
For Each ctl In Me.Controls
ctl.Value = Null
Next
That didn't work either.
View 4 Replies
View Related
Dec 4, 2013
I have a DB with 4 tables:
Property (used for look-up values)
Service Type (used for look-up values)
Rate Table (uses the Property Table and Service Type Table and is used as a rate look-up table for the daily service table noted below)
Daily Service
Using the Daily Service table, I need to choose a property, choose a service type that is limited to the property (100's of service types, but a property may only have a limited number), and enter a quantity, and have the Rate Table return the specific cost of the service. I didn't think this was too hard in Access (2013), but I seem to be hitting a wall and spending too much time figuring it out. Now I am behind in my project.
I have been trying to do this in a table format, but have been unsuccessful in limiting the results of the Service Type combo box based on the property chosen.
View 2 Replies
View Related
Nov 8, 2013
In the default property of a subform control I want to use a control of the main form without using names of forms, but using me and parent.
I used in default property of cboVATDetail: =Me.Parent!cboVAT, but it is not accepted. My aim is to use cboVAT of parent as default in cboVATDetail of child.
View 3 Replies
View Related
Apr 11, 2013
New to the navigation form: I need several forms in the navigation form to all relate to the same client ID field. I have this information on the main form but the form with in the navigation form will not pick it up.
I have tried =[Forms]![Frm Client Information Navigation Panel]![ClientID] But just cant get it to pick up that information...
I would like to have something like the master link fields and, child link fields but when I add a form to the navigation form this option in not available.
View 1 Replies
View Related
Feb 15, 2005
Hello,
I have an Orders form (frmOrders) which has a subform (frmOrderDetails) detailing the individual order items. For example, there is one order which may consist of many items.
The problem I have experienced is that if someone completes frmOrderDetails first and then moves to frmOrders the records are not saved correctly. I know this is because the main form frmOrders has not been saved or had a field completed which would produce an OrderID which can be linked to frmOrderDetails.
Whilst I could say to users they must complete a certain field first, some will forget and I would like to protect against this.
Whilst the tab order will go to a field on frmOrders, is there a way of forcing users to complete this field before they enter frmOrderDetails.
Alternatively, is there a way of coding a command button to initiatve an OrderID.
Or do you have any other suggestionsm
Thank you.
View 3 Replies
View Related
Oct 19, 2005
I have a command button on a main form which on 'on click' enables a number of fields on the main form that were previously enabled = False to be enabled = True.
The problem is I also have a sub form within the main form where I want to do the same. (A number of fields within the subform are also set to false and I want them to go to True) I can set a seperate button up on the sub form to do the same but I would much prefer the button on the main form did the whole lot.
The problem is I haven't a clue to the VB of how to include fields within the subform as well as the ones on the main form.
For info the main form is called FrmTblMain and the sub form SubFrmProject
The fields on the subform that I wish to set to true are 'First' and 'Second'
Any help will be appreciated.
View 3 Replies
View Related
Sep 27, 2013
i have a main form for customers and a subform for sites which is set to locked so its displayed as just a list. I have a button on my main form to add a new site for the current customer displayed..How can i get the Main form '1CustomerDetails' with subform '2SiteList' to automatically refresh one i've clicked the save button on another form.
View 1 Replies
View Related
Jan 17, 2006
I have a Main Form with 10 Buttons on the Left side (Right side of the Form is Blank. On Click the Main Forms Closes and respective Forms opens based on the button I Clicked.
Now over here I wish to Keep the MainForm OPEN and subsequently open the other Form on the Right Side in Blank area.
Request for the SmartTips to startover -Thanks
View 1 Replies
View Related
Feb 18, 2005
Note: I put this in General original but it is rmore likely to be a table structure problem
I have a single table for storing the main data, this is fed by input from 3 forms. I have been asked if the forms can be used independantly and remotely as input forms.
My solution was to simply send out a database with just one form and created an append query so that when it is returned with completed information it would simply append the database to the main database. In itself this works fine however, what is happening, of course, is that when I get the other forms back I end up with triplicate records, that is instead of the information from the 3 forms being stored as one record it is now split over 3 records.
I have to be careful in what I do as the original database has been running for over 6 months now and has a lot of stored data and because of established queries/calculations/reports the last thing I want to do is change or split the main data table.
Is there anyway I can get the three records to concantenate on one line. The three forms all have separate fields as they were taken from the original database.
View 7 Replies
View Related
Mar 15, 2013
I have this form that contains subforms to hold different types of infomation for different clients. At the top of the form it has the case #, first name, last name, and then a tab element in which each of 6 pages (tabs) holds subforms for other information associated with the client.
I have a table that holds only client number and name.Then each of the six subforms operate off of a table, and all the tables are connected through relationships using client number, first name, and last name.
How could I make the subforms autofill their cooresponding tables using the case #, and name fields from the main form without having to repeatedly input the client #, names for each tab/subform?
View 4 Replies
View Related
Apr 21, 2015
I have a form that shows information on a person (think first name and last name) at the top and contains tab controls that hold subforms each containing a different set of info about that particular person. Ex: for person 1 the main form will display the persons first and last name as well as show the subject tabs. as you click on each tab you should see the information that pertains to that person. I would like to step through each ppeson one at a time using the horizontal record arrows (eventually I will change this process to using forward and back buttons) on the main form with the persons names changing as well as the information in the subforms changing to match the person on the main form. I can step through each separately (main form and each subform) but I cant get the subforms to change information when the main form changes persons. Seems simple enough but I cant get the subform to change when the main form changes. They are not connected. This is for an Access class that I am taking and we use Access 2013.
View 2 Replies
View Related
Aug 10, 2013
I have a form and a subform for data entry.It is often the case that not all the data may have been entered and so a user might need to go to recordID 24 in 30 already entered main records.However, he needs to get to that record via a (unique) 1-1 field. How do I create the form so that as well as being able to go to the first, the last, the next, the previous record, I can go to a record of my choice.
View 5 Replies
View Related
Jun 27, 2013
All using 2010. I need to filter a subform from the main form.
Code:
sfrmMedCInfo.Form.Filter = "[SSNum]= '" & cboSSN & "'"
sfrmMedCInfo.Form.FilterOn = True
It's throwing an error: Variable not defined pointing to sfmMedCInfo. why do I need to declare the subform and how?
View 3 Replies
View Related