Dual Table Query In Subform
Nov 7, 2005
I want to do a query on a subform which picks up an ID field on the main form without using this as the connecting master, child key but finds this ID in one of two fields in the full table. My problem is, how to pass this field value from the master form to the query. I would use OpenArgs if I was calling another form, but how would one do this in a subform?
I would be most grateful for any assistance as this problem has been puzzling me for some time
View Replies
ADVERTISEMENT
Dec 2, 2011
How to add my own rows to a query in MsAccess ? I would like to do something like this: Select Name from Table 1 where age > 75 Union Select "Joe" from Dual; Expected Result: If Joe is not found in Table 1 ,then it would be added to the result of the query.How can I do it in MsAccess as it does not use " DUAL" table.
View 1 Replies
View Related
Jan 24, 2006
Hi Guys
Just like to say that I am almost ashamed at how little I know about access, so I guess over the months I will be taking out alot more than I will be putting in! Anyway, I have the following project to do.
Basically it will be necessary to download from an ODBC database on a daily basis, and there will be around 300 products. Each product will be made up of 12 individual fields. What I would like to do is manually key in against these fields from a paper reciept and it will be only shown if the manual input matches what has been downloaded ie Say one of the fields is "Colour", and from the download it says 'Red', therefore if I manually type in any other colour an error message will come up. The basic reasoning behind this is I want access to act as a kind of manual checker from our downloads, with an audit trail of what is being checked. Any typos would be negated as the field would be highlighted, and therefore the inputter can double check any incorrect fields. The current process is done by sight and obviously this means that errors get made as well as no audit on what has been checked.
Anyways thats the theory behind it, can anyone offer me any tips to help me off as I have no idea where to begin! Indeed, is Access suitable for the job? I am presuming that every field will have to have a Vlookup when text is manually keyed in against the download?
Any help is appreciated. Literally any as I am in way over my head!
Regards
Mike
Sorry for the typo in the heading!
View 3 Replies
View Related
Aug 21, 2006
Hi,
I am creating a database where the serialID can be a number of different 'formats'. TBH, I don't know if this can even be done in the first place, but on the off chance that it can....:p
Firstly, i'm not sure whether to use Input Mask or Format...
But the serial may be '1234567AB', '12345678AB' or '12AB1234AB'.
Or to put another way
'7 numbers 2 letters',
'8 numbers 2 letters'
or '2 numbers, 2 letters, 4 numbers, 2 letters'
I have tried creating a mask such as '00LL0000LL' (can't remember exactly, had some '9's in there too some where...) but just keep hitting a brick wall, whereby it not satisfying all of the types.
Any help much appreciated, Ben
View 1 Replies
View Related
Oct 12, 2005
have a table i am creating for a subform to calculate a price for a line total.
[item] [amount] [weight] [yeild] [linetotal] *[need coverted price from a query]
the converted price is in a query and i would like to load it with its selected item in a table (or form?) so i can multiply for a line total in the subform.
is this easy?
View 1 Replies
View Related
Jun 12, 2013
When I started building forms to fill my junction tables, the example that I looked at based them all off of queries. That's what I've done for the most part. However, this latest subform that I've made and embedded into a main form is based off of a table. Will that cause problems for me down the road? I'm not so far with it that I can't redo it off of a query, I just don't want to!
View 3 Replies
View Related
May 29, 2015
I have a main screen that has a tabbed form in it. Each of those tabs has a sub-form in it that displays information and allows some information to be updated.
In one tab I have a query based sub-form that returns information related to the project. This information cannot be manipulated or changed as it comes out of a company managed database. I would like the analysts to be able to add more granular information to a new table by inputting information in a dropdown field for one of the new table fields, but utilizing two of the existing sub-forms fields as identifiers in the new table.
View 14 Replies
View Related
Nov 8, 2014
I have a query which looks for like * surname*
in tblemployee fname lname dept active
this works fine and i can search using a requery button
however as deptartments are stored in tbldepts
when i change the query to retrieve the dept name instead of number directly from the table and i try to change this on the datasheet subform it changes it in tbldepts instead?
how can i change what dept the employee is in (as in change the number in tblemployee - but display the actual name?)
View 1 Replies
View Related
Sep 16, 2014
I have a form, a couple of comboboxes and text boxes on it. When these are filled out, the SQL of a query is changed using these parameters.
There are three subforms on the form, all pivot charts, all based on the query being changed.
The goal would be to update all three according to the user-given parameters.
Right now the subforms only update if I close and open the form, which is probably not the best solution, since it's too slow.
I've also tried to requery and refresh them, with no result.
Then I tried to overwrite the recordsource of the subforms with the same text that was originally there. This got them to refresh their data, but then all of the charts disappeared and had to be built again, so this is a no go too.
View 7 Replies
View Related
Mar 22, 2013
I have 3 table table; Invoice table, Product table and Sale_product table. Sale product table records all sale from the product table
Invoice table has these fields
ID
TOTAL
CASH_TENDERED
CHANGE
Product table has
ID
CODE
QUANTITY
NAME
PRICE
and Sale_Product table has these
ID
PRODUCT_CODE
QUANTITY
PRODUCT_NAME
PRICE
SUBTOTAL
INVOICE
I did main form from Invoice table and sub form from Sale_product table. I want to use DLOOKUP function to load the name and price, quantity and calculate subtotal automatically from the product table based on the product code entered. i have being trying hard and i keep on getting "Name? error"
View 1 Replies
View Related
Mar 8, 2012
I have a Traits table that has fields TraitKey and Trait and I'm looking for the subform to show one record for each trait so that I can give the employee a score for each trait.
I'm trying to save that score in an EmployeeTraitScores table that has the fields EmpID, Trait, Score.
If I bind the subform to the traits field, the continuous form shows each one properly but then I don't know how to save to the scores to the EmployeeTraitScores table.
If I bind the subform to the EmployeeTraitScores table then it can save a record but I can only get the Dlookup to show the first trait.
View 3 Replies
View Related
Jul 13, 2005
Hi guys, wondering if you can help because no one I've talked to can so far..
I've got a form with Room information on, and on it a subform. The subform contains information from 2 tables (Items and Audit). Items is basically a list of all the different combinations of furniture item that can exsist (a damaged green chair, a large new desk etc) and as theres only about 70, and 1000's of bits of furniture I decided having common entries would be a better method to save on memory.
Right, the Audit table contains a Room# field and an ItemID field, obviously each furniture item within the Items table has a unique ItemID. The subform is created displaying the information from the Items table, so it tells you that its a damaged green chair rather than just giving you the number 3, and has the ItemID hidden, just for linking purposes.
This works fine for displaying information, but I can't make it so the user can add a new record. If a new furniture item needs to be added then they want to be able to type (new blue chair) and not the ItemID number, so the subform somehow needs to lookup the ItemID from the information typed in as a new record, and then write this ItemID into the Audit table, before refreshing the form. Obviously though at the minute, if anything is added to the subform, it just goes onto the bottom of the Items table, and hence repeats whats already there, which is silly.
I'm just not sure how to go about doing it and would appreciate any help or advice that can be offered. If I've not explained clearly enough please let me know.
Thanks!
View 1 Replies
View Related
Jun 29, 2006
I have a subform in which I use the following statement =forms!frmetc.model It is picking up data that is listed in the form that it is a child of. It picks up the data just fine and shows it properly, but the fields in the table associated with it remain blank. Any suggestions of the right was to accomplish this task? Thank you!
View 1 Replies
View Related
Feb 7, 2007
I have been building my DB and learning everything from scratch. If anybody could give me any advice as to where I may be going astray, it would be much appreciated as I feel like I've hit a brick wall. I run a building firm and need a DB to look after customer information, write estimates, invoices and ultimately do the accounts.
I think my DB needs are very basic to start with and I'm guessing the system only needs to be fairly simple and straightforward. So far my DB has:-
•Customer form with an in-built Estimate subform - this form gives me a brief outline of the customer and how many estimates I have for him.
•If you then double click on an estimate number (in the Estimate subform) this takes you to my Items form (when I create an estimate normally in Word, I have to break jobs down into their components and price each item individually, hence I made an Items table). Each item has an Item Cost.
•I then run the report “Estimate” and have set up a total calculation box on the report ready to print it out for the customer.
My problem is that I would like to know how I can get the Estimate Total to appear in my Estimates Table and Estimates Subform. So far I have achieved making a crosstab query to calculate the Estimate Total (Amount) for each specific Estimate ID, but I cannot get the Total from the Crosstab Query into the Estimate Table, from which I would probably be able to get it into the Estimate Subform. I have a suspicion I need to build an expression in the Estimate Subform - but.....
Once I am over this problem I will want to turn Estimates into Invoices and have that data displayed in my Estimate Subform too, although I think I have got a good idea of how to do this, I would again be open to comments/advice if offered.
Thanks Steve
View 1 Replies
View Related
Aug 12, 2005
A user recently made a change to a table in an Access 2000 db (I know, but I’m a volunteer and the org’s a nonprofit that insisted on access to the tables, etc). First he copied the table and renamed it ("basicdata--orig"), then made the change to the copy and gave it the name of the original table ("basicdata"). This table is filled by entries in a form that also has several subforms that create records in linked tables.
Data entered into the main entry form are correctly inserted in the new table ("basicdata"). Data entered in the SUBforms, however, now cause an error stating that the data cannot be saved because no corresponding record exists in "basicdata--orig" (the table that was replaced). Apparently, the main form retained the linkage to the table NAME "basicdata", but the subforms somehow followed the original table's NAME CHANGE and are now looking to it for the corresponding records. Of course, the records are not there.
1) I'd like to understand just what went on here and 2) I cannot find any refence to "basicdata--orig" in the properties of the subforms so I don't know what to change to correct the problem. I realize I could correct it by switching the table names back again, but that action would necessitate some reentry of data that I'd like to avoid.
I know this is probably as clear as mud, but if anyone has followed it and has some answers, I'd sure appreciate hearing them. Thanks!
View 2 Replies
View Related
Oct 19, 2005
I have a form to enter records in a table of staff attending training courses, in the form is a sub-form based on a query from a different table. When a staff number is entered on the main form the staff name grade etc appears on the sub-form, my problem is that I need the table to be updated from the main form and the sub-form. Is there a way of doing this?
Thanks
View 1 Replies
View Related
Oct 22, 2013
I have a form which have a sub form. In the sub form I have a the direct table to update data on it.
Example:
The form has the name of the project and the subform the name of one of the items of the same project and the table present the documents for the particular item.
The users have the option to add or edir docs to this item.
If I would like to reffer to a value they are entering on this table in VBA . how can I do that?
(I would like to present a msgbox when they are entering a date that isn't right on the table for this item.)
By the way, I can't use validation rule because I have a different dates needed per item.
View 2 Replies
View Related
Nov 9, 2014
I have a many to many relationship between tblMain and tblComp, where the junction table is jtblMain_Comp. The real life scenario is one person can have many complications, and each complication can be encountered by many people.
I've set up a form with a subform, to enter multiple Comp. I thought that by defining the relationship, the MainID would be entered into the junction table whenever a Comp is entered, but I'm clearly missing a step.
View 3 Replies
View Related
Feb 7, 2013
I've only started using Access 2010 since the beginning of January and have googled almost every problem to date.
My db is used to show the status of material through a manufacturing process. We start with one slab of material which gets cut up in to many parts.
The db works so far however I've come to the conclusion that the date was not normalized correctly. So I've created the following tables to fix this.
I have two tables the first of which holds data on the slab we start with and the second shows the status of the parts it has been cut up into.
Table 1 has the following fields
Cast Number
P/O
UST Status
UST Comment
Table 2 has the following fields
Cast Number
Blade ID (which will be 1 to 32)
Status
Comment
I would like table one to be displayed on a form with all fields. Have table two as a subform on the main form. But here is where I get lost!
I need the subform to show 32 text boxes to represent each part. Have each box assigned a default blade ID (1 to 32). Then depending which of the 32 text boxes get used to update those multiple records within Table 2.
I did have 32 status fields for every part but realized that meany were left null. I'm using, Access 2010 with Win 7...
View 5 Replies
View Related
Aug 5, 2005
I have the following tables:
tblProjects
ProjectsID (Primary key - exclusive)
ClientProjects
tblProjectsDetails
ProjectsDetailsID (Primary key)
ClientProjectsDetails (Secondary key)
tblQuotes
QuotesID (Primary key - exclusive)
ClientQuotes
Service
Rate
tblQuotesDetails
QuotesDetailsID (Primary key)
ClientQuotes (Secondary key)
Service
Rate
I have the following forms:
fmProjects
fmProjectsDetails (parent/child)
fmQuote
fmQuotesDetails (parent/child)
When I add a project I need to have data from the tblQuotes and tblQuotesDetails to populate tblProjects and tblProjectsDetails respectively.
It is very easy to populate tblProjects from tblQuotes since it is a single record. Therefore I use:
Me.ClientProjects = Me.ClientQuotes
:confused:
The question is: how to match the data of the 2 subforms? Since there will be more than one record per subform?
Any help is really appreciated.
View 2 Replies
View Related
Jul 19, 2005
Help me! I'm creating a supplier database at the moment. I have a pivot table that allows users to filter the list of suppliers by programme, primary product & company name. I'd like to make it so that double clicking on a company name opens that suppliers details in a new form (which I have already made). How do I do this?
While the knowledge is flowing, I'd also like to make a button that will reset/remove the filtering from the pivot table. Any idea's?
Thanks guys!
View 3 Replies
View Related
Dec 3, 2005
I have linked a SQL table to my ms access database. In order to view the SQL table as read-only and still be able to update the access table I have setup a form with a subform.
I know it would be a dublication of data but is there a way thru code of copying the data on the subform to my access table. I was hoping I could put a button on the form that would copy this data. My idea is after the copy is done all the information I need will be in my access table. I'm new to this linking idea and am worried I will only have half the information I need if the link breaks etc.
Thanks
View 1 Replies
View Related
Nov 6, 2006
This is either a no brainer or falls into the calculated field syndrome.
My HR database stores Employee job history records. I display the current job (condition Null EndDate) in a subform. I would like to store the Division ID of this Job in the Employees Record, to make it easier to create Divisional reports. I am able to display the value by setting the Data Source to the subform field name value, but it won't write the value to the table. I have to manually type it in. There's definately some learnin' here!
Thanks for listenin':)
View 4 Replies
View Related
Jul 1, 2013
1. I have a Main form (based on a table) with a Subform.
2. The Subform is based on a Query
I want to save the data from the Subform (Salary Field) to my Table, I dont know if VBA will be the best option.
TABLE FIELDS:
ID*
EMPLOYEE_NOS
NAME
SALARY
MAIN FORM FIELDS:
ID*
EMPLOYEE_NOS
NAME
SUBFORM FIELDS:
EMPLOYEE_NOS
SALARY
View 2 Replies
View Related
Jan 6, 2015
Here is the set up. I have a primary school database.
There is a main form that shows the students name and class.
The main form contains tabs for each subject (maths, english etc.). Each tab has a subform that is supposed to allow me to enter a comment about the student's progress.
My tables are set up properly (as far as I can tell).
The tables (simplified)
tbl_Students (has StudentID, StudentName)
tbl_SubjectList (has SubjectID, SubjectName)
tbl_Comments (has CommentID, SubjectID (foreign key), StudentID (foreign key), Comment)
The forms
The Master and Child (main form and subform) are linked using StudentID.
I use a query for fields in the Master form. Each subform has its own query that shows results for a particular subject.
The problem
My subform allows me to edit an existing comment fine (if I enter dummy data directly in a table).
BUT, if there isn't an existing comment, and I attempt to enter one, I get an error - "YOU CANNOT CHANGE A RECORD BECAUSE A RELATED RECORD IS REQUIRED IN TABLE tbl_Subjects."
What I have tried
I understand this error means I am violating referential integrity rules. But I can't see why. The tbl_Subjects is populated with 10 subjects and I am only trying to put a comment against an existing SubjectID.
I've checked that my Form Master / Subform Child is ok. I experimented with having StudentID _and_ Subject_ID to link the master and subform to see if that worked. It only made things worse because my subforms wouldn't display correctly.
View 5 Replies
View Related
May 26, 2015
I am working with a database that deals with trailers. What is happening is a salesman takes an order for a make and model for a trailer for a customer. The customer can then add some customization to the trailer such as more tail lights or tie down straps. They add the customization on a form called frmCustomQuote. On frmCustomQuote there is a subform called sfQuoteConfigs. On sfQuoteConfigs there is fields such as category and sub catergory that get populated bases on what was selected.
On frmCustomQuote there is a button called "Copy Quote" this will allow the salesman to make an exact copy of the trailer and customization. The quotes are held in a table called tblQuotes and the customization is held in tbQuoteConfigs. Now my problem is when I click on Copy Quote it only copies the first record into tbQuoteConfigs. I can't figure out a way to tell my code to move to the next record within sfQuoteConfigs.
My code:
Code:
Option Compare Database
Option Explicit
'Setup ADODB connection to the tblQuotes
Dim adoQuotesCustomQuote As New ADODB.Recordset
'setup ADODB connection to the tbQuoteConfigs
Dim adoQuoteConfigsCustom As New ADODB.Recordset
'Dim the Variables
[code]....
View 4 Replies
View Related