Record Source For One Form Multiple Tables
Mar 26, 2005
I am making a master form for three tables which ultimately form a hierarchy. I am getting all the fields from each table onto one form. By default the record source would be made up of an INNER JOIN such as below
SELECT PERSON.first_name, PERSON.country, PERSON.last_name, PERSON.street, PERSON.area, PERSON.city, PERSON.telephone, CONTRIBUTOR.registration_date, CONTRIBUTOR.fav_category, MUJAHED.profession FROM (PERSON INNER JOIN CONTRIBUTOR ON PERSON.id=CONTRIBUTOR.id) INNER JOIN MUJAHED ON CONTRIBUTOR.id=MUJAHED.id;
I'm trying to change the record source to match using the where clause instead. However the following allows me to view but not add a new record
SELECT PERSON.first_name, PERSON.country, PERSON.last_name, PERSON.street, PERSON.area, PERSON.city, PERSON.telephone, CONTRIBUTOR.registration_date, CONTRIBUTOR.fav_category, MUJAHED.profession
FROM PERSON, CONTRIBUTOR, MUJAHED
WHERE (PERSON.id = CONTRIBUTOR.id) AND (CONTRIBUTOR.id = MUJAHED.id);
A tip or guideline on how I can correct this will be appreciated.
Regards
View Replies
ADVERTISEMENT
Sep 21, 2004
Currently I have over 600 columns I need to use in a query and since the limit is 255 columns per query, I need to create multiple queries. Currently the form shows the record source of the single query I have created. Now that I need to create the other queries, how do I have the forms record source to recognize the other queries as sources as well?
Thanks,
JGM
onesweetdude@hotmail.com
View 1 Replies
View Related
Nov 17, 2014
I currently have a pharmaceutical lot database set up in the following format:
MFGData (table w/Manufacturing Info)
QAData (table w/ Quality Assurance Info)
QCData (table w/ Quality Control Info)
PASData (table w/ Process & Analytical Science Info)
SCData (table w/ Supply Chain Info)
[Code] ....
Each table has a corresponding form for data entry in each area. The tables were subdivided in this way in order to limit each department's ability to edit the data of other departments. The only field common to each table is the drug lot number, or "Lot #" (which is the primary key of each table).
I wanted to make it so that when Manufacturing enters a new lot number on frmMFGData, it automatically creates that lot number in the other 4 tables. This process mirrors our actual real world business process, where drugs are manufactured and assigned new lot numbers by our manufacturing team, and then other departments simply reference those numbers when doing their part.
To accomplish this, I went ahead and set up 1 to 1 relationships between the various tables using their "Lot #" fields, establishing referential integrity and enabling cascading updates. However, when I attempted to enter a new lot number into frmMFGData (the manufacturing form), it didn't seem to appear in any of the other tables. If I edit an existing lot number and change it to something else, the change does carry over to the other tables, so I know that the cascading updates are working in some capacity.
If cascading updates cannot "cascade" new records, then is there any other way to accomplish this?
View 13 Replies
View Related
Mar 28, 2015
I am building a form to create a user record and at the same time i have some yes/no options which are located in other tables but when i want add a user i cannot select any yes/no options they seem locked?
View 1 Replies
View Related
Dec 31, 2014
I have a form "frm_PatientNew" based on table "tbl_patients", this form contains a button "cmd_NewVisit" which is supposed to do the following: opens the form "frm_NewVisit" for recording a new visit for the last recorded patient in "tbl_Patients", I found many approaches depending on DMax and Dlookup and they worked fine just if "frm_NewVisit" is bound to "tbl_Patients", but "frm_NewVisit" is bound to "tbl_Main" which acts as a container for all information (patient data, visit data,service done and service provider), so the form "frm_NewVisit" contains fields from different tables. I wonder if I should create "frm_NewVisit" as unbound form, then adding fields from different tables to it and using vba to populate "tbl_Main",
View 2 Replies
View Related
Sep 20, 2012
I created a table in a budget database without a autonumber field. I then inserted a autonumber field after creating the form by inserting a row in the table which works fine in the table, now i want to use a text box on the form with BudgetID from the autonumber field to give me the total amount of records in the database but the autonumber field is not in the record source dropdown.
View 5 Replies
View Related
Nov 16, 2005
I have a main form that has 10 sub forms Each sub form’s record source is link to a different Query.
It takes more then a minute to open the form, (because it’s running the query for all sub forms). So I changed the sub forms source to SELECT * FROM tblTest WHERE false;
I also changed the main form. When the button on the main form is clicked, it’s adding the following:
Me.SubMySub.Form.RecordSource = "select * from qMyQuery"
Me. SubMySub.Form.Requery
However, after I close the main form, the sub form’s record source stays linked to
SELECT * FROM qMyQuery;
And will take the same long time again to open the main form.
Does anyone have any solution?
View 7 Replies
View Related
Feb 8, 2005
Hi all,
I have Form F_CashSalesHead with a subform F_CashSalesInvFoot with one-2-many relationship on their tables. Subform contains a checkbox field that I use to lock the record set (On a command button click it runs one update query to add value 1 to each checkbox to make Enable=False all the records of current invoice on the form).
One-2-many relation ship is made on InvNum field in both tables.
When I open F_CashSalesHead form, bcz of some code line I wrote on On Load event of F_CashSalesHead , at the beginning it give massage how many invoices are pending to lock and would you like to see. If click “Yes” to see list, it opens a small form that called F_Count_Unlocked_Invoices showing invoice numbers and unmarked checkbox which is pending to lock. This small form is based on following query,
SELECT DISTINCTROW T_CashSalesInvFoot.InvNum, T_CashSalesInvFoot.CashSalesCustomerName, Sum(T_CashSalesInvFoot.Lock_Cash_Inv) AS [Sum Of Lock_Cash_Inv]
FROM T_CashSalesInvFoot
GROUP BY T_CashSalesInvFoot.InvNum, T_CashSalesInvFoot.CashSalesCustomerName
HAVING (((Sum(T_CashSalesInvFoot.Lock_Cash_Inv))=0));
This works fine.
What I am looking for is, I want to use the same F_Count_Unlocked_Invoices form for Credit Sales invoice also with the same trick. Because I don’t want to create another same form and write code that help to increase size of db.
Can it be done just by changing record source of form F_Count_Unlocked_Invoices? Or what is the way to do it?
With kind regards,
Ashfaque
View 2 Replies
View Related
May 17, 2005
Heya. I hate posting yet another cascading query but I just poured through the first 40 bits and couldn't find something similar.
Basically, I seem to have an errored idea in how to effectively used cascading boxes on a larger form-wide scale.
Basically I have a form with an unbound combobox in the form header: cboSchool
The detail section should only have two fields, StudentID (txtStudentID) and a boolean (bolOT) both of which exist in a specific table source (tblStudents). StudentID is a locked field.
What I would like to do is only have the StudentID's available that are valid for the school. I attempted using a query in the record source that would reference cboSchool but I keep ending up with blank forms. (There's a string of queries that link the schools found in cboSchools to StudentID)
Any ideas?
~Chad
View 5 Replies
View Related
Jan 10, 2006
Hello,
I'm having a strange problem and was wondering if anyone can help me out. I have a form that is for inputting and modifying data in one table. It used to work when you opened the form you would see x amount of records. Now it's opening to 1 blank record. If you hit filter it fliters like 1700 records and then when you unclick it, you get the entire 10000 records. I thought it had something to do with the Record Source in the properties but when I fixed that it still didn't work. Any ideas?
Thank you!
View 2 Replies
View Related
Aug 31, 2004
I have 2 forms. On form1, the record source is a query. From form2, I need to iterate through the recordset from form1 and perform some action. How do I access the recordset from form1?
Thanks in Advance,
-jnoody
View 1 Replies
View Related
Jun 19, 2014
This code loads a new subform in the frame. It then scopies a value to an input field but then i need to set the record source and display the data. This latest pasrt does not work.I've been trying for some time now by changing the part before recordsource but no luck.
Code:
gekozenwo = Me.Keuzelijst0
Forms!switchboard.subfrmWindow.SourceObject = "frmInformation"
Dim frm As Form
Set frm = Forms!switchboard.subfrmWindow.Form
frm.DataEntry = True
Forms!switchboard.subfrmWindow.Form!Tekst33 = gekozenwo
MsgBox gekozenwo
frm.RecordSource = "SELECT * , [orders_maint_detail]![woisnr] & ' / ' & [orders_maint_detail]![Ordernummer] AS Expr1 " _
& "FROM orders_maint_detail " _
& "WHERE (((orders_maint_detail.woisnr)='" & gekozenwo & "'));"
Me.Requery
wonr = gekozenwo
View 2 Replies
View Related
Sep 19, 2005
I have an unbound form with three tabs. On each tab there is a sub form. Each tab is a search form and each sub is a results returned. I have made everything unbound and set the sub form recordsource and its controls control souce on afterupdate of the main form search criteria. Works fine except for after some use the db decides the sub forms are not unbound and sets the record source and control sources.
I'm trying to do a
Me.PollingPlacesResults.Form.RecordSource = ""
Me!PollingPlacesResults!PollID.ControlSource = ""
but this does not seem to work in actualy removeing the record source and control source.
View 14 Replies
View Related
Feb 23, 2005
I have Form A that has a combo box and a "Submit" button. When the user clicks on the Submit button it needs to open Form B. Recordsource of this Form B is "Query B"
Item selected on the combo box becomes the criteria for "Query B and Form B needs to be opened based on that criteria.
What is the easiest and fastest way (no dlookups please!) to do this?
If an illustration is possible through an example that will be wonderful.
Thanks in Advance.
View 1 Replies
View Related
Aug 26, 2005
I have a form where users enter data in various ways - combo boxes with drop down selections and text boxes where users manually enter some data. I also have several text boxes that return "answers" based on calculations from user entries mentioned above. The form is bound to a table where all the entered data is stored. I'm having trouble saving the calculated information to the bound table. It's easy in all the non-calced boxes, I just put the column name of the bound table in the control source, but in the calculated fields, I already have the formula in the control source. How can I identify the proper column to save the data in this case.
Thanks!
View 5 Replies
View Related
Sep 22, 2005
I'm looking to change the record source of a report and then print the report depending on what button the user clicks on.
Is there some way to do this?
View 8 Replies
View Related
Nov 13, 2013
Form - record source - select a table that when the user enter a value in the field of the form it gets place into the designated table (select a table). my problem is that I have two fields in the form, one field from the data entry is suppose to go to the train table,and another field the data entry is suppose to go to the station table. if I have the form's record source have a designated table for the data entry.It doesn't have two tables for the data entry.
View 13 Replies
View Related
Oct 26, 2006
I am having some problems with an Access database, obviously.. relatively new at the whole thing, so it's quite a patched-up mishmash, and I would be happy to expand on the intended structure, but it would all come together if there's a way to use a form-displayed GUID as a record source criteria.
Essentially, I can do the following:
Form 1 with autonumber GUID 1 has a text field on it which is equal to the autonumber GUID 1 field for the current record. This looks like a series of random characters, nothing like the long number, and it's set to be invisible. It then works, on a subform, to set record source criteria to include this text field as a way to delimit subform 2 by (non-autonumbered) GUID1.
However, what does not work is:
Form1 has an unbound lookup list that includes GUIDs as one of the things displayed. These are displayed properly, as a long number. I can set a text field equal to the value of this on the main form, and see the same long number. But I cannot then reference this text field as a criteria for the subform record source, and neither can I reference the lookup list directly. Essentially, it works when the text field is showing squiggly numbers, but not when showing the 'real' GUID.
Is there a way to convert the nice-and-tidy looking GUID from an unbound lookup list to something usable as a record source criteria? Or is this always possible, and I am just missing something elsewhere? I can do this through VBA for a _filter_ criteria with the ={guid " & guidvariable & "}))" thing, but haven't found a way for record sources.
The structure is rather convoluted.. would be happy to explain if there's no other way to do it. Replies greatly appreciated.
View 1 Replies
View Related
Dec 17, 2013
In my Access adp, when I open a certain form (frmVertebrates), the databinding occurs in the Load event for the form, for various reasons. I have not specified any datasource in the form's design view.
Databinding for frmVertebrates:
Code:
Me.Form.RecordSource = "select * from dbo.vertebrates where catalogID=3"
This works great when just opening the form. However, when opening with a filter from a button on another form it won't work, the form displays all records.
Button code:
DoCmd.OpenForm frmVertebrates, , , "vertID=123"
Obviously, this makes sense, since the record source is explicitly set in the Load event.
Is there a way to capture the filter "vertID=123" so it can be added to the Form.RecordSource sql?
When breaking in the Load-code and watching the 'form' variable, I can't spot the filter condition anywhere...
View 4 Replies
View Related
Jun 13, 2014
How can I set the record source of a report to a saved query through VBA. I am trying to use the same report for a number of uses, all of the info on the report is the same, but the only difference is the query that the information is based on. I have this simple code below, how do I add a record source to it (if it can be done)
DoCmd.OpenReport "SellRPT", acViewReport, , , acNormal
View 2 Replies
View Related
Jan 15, 2014
Access 2013 on a Window 8.1 system.
I have a combo box based on a look-up table which I use to filter the records in the form. Seems after closing the form and reopening it, the filter remains.
I'm not sure if this is referred to filtering or restricting the records.
The value in the record source doesn't get changed but the records displayed don't reflect this. The records shown are the last filter I selected in the combo box.
The only work around I have found is I must explicitly set the record source in the on open of the form.
The was not occurring with access 2010. And I have made no changes what-so-ever.
View 5 Replies
View Related
Aug 20, 2013
I have one form which houses all my product information via the use of a query and subforms where appropriate. I would like to filter it in order to find records missing certain information.
I want to filter the information using a combo box.
The combo box has a user friendly name (Product Dimensions) and the name of a query related to that name (qryfilter_missing_prod_dims - this query is the record source query for the form plus the query that has the missing info, the query is set to return all records that match ie. all records that are missing info).
I want to write a vba code to filter my form based on that query.
And i can't get it to work using the cmd.applyfilter (docmd.applyfilter me.cbo_missing)
I've also tried to use me.recordsource. when i do it filters perfectly, but i can no longer edit any of my data in the form.
How to filter my form using a query that is not in the native form's record source?
View 3 Replies
View Related
Mar 25, 2015
I have a form that is linked to a query by its Record Source.In one of the Text boxes I want to appear the number of rows in the query where Days = 4 so I thought I would try to use DCOUNT as the Control Source for the Text Box. However every expression I try for DCOUNT throws back error? or name?. How to sort my code?
=DCount("[EPISODEUNIQUEKEY]","1-12 Show Records by Date Range","[Days] = '4'")
View 3 Replies
View Related
Jul 27, 2005
In short can I display a field on a form that is not in the forms field list without using a sub-form? I am trying to show a value from a query on this form. I tried this in the control source:
[qry_op500_entry_delta]![countofphone model]
I get an error stating that this is not in my field list for the form.
If the answer is No or if needed I can give more information on what I am trying to do.
View 6 Replies
View Related
Aug 21, 2012
I have an application written in Access 2007 and packaged using the Packaging Solutions for deployment with Runtime.My problem is that I've written an updated version, and after carefully saving my original Back End away from the install site, uninstalling Runtime and the FE, installing the new FE with a blank copy of the BE having the same name and Runtime, and copying the filled BE into the same folder with the FE (replacing the linked, but empty, BE) I find that SOME of my tables in the BE are not being recognized. This isn't true of all tables. I can open some of the forms and find everything there. In other cases I get the following error message "The record source "tblName" specified on this form or report does not exist."
View 2 Replies
View Related
Mar 29, 2014
In my database I have a form who's record source is a query. That query is based on a table, and have set a criteria on one of the fields.
When I use the form to add a new record I want the value of the field in question to automatically be what I have specified in the query.
Instead, the record is added but without having that value in the field, and when I go back to the form it doesn't display the record because it doesn't meet the criteria specified in the query that the form is based on.
View 2 Replies
View Related