Query Refrencing Form For Data

Aug 20, 2006

I have a form with several textboxes on it. If i double click on a textbox it sets the value of another textbox to what I have asked it to in code. This works fine.

I need to use the value from the text box in a query to extract data. The value that is put into the textbox is a particular field in the table. There are 26 similar fields.

I could write 26 queries, refrencing the field I want, but thats not really efficient.

Can I somehow refrence the textbox on the form from the query to extract the data.

View Replies


ADVERTISEMENT

Refrencing A Combobox's Values

Mar 9, 2006

How can I refrencence any value within a combobox (not the one selected)? I want to try and acheve something like this:

cboSomething.Value(3)

Although that doesn't work. Is this possible?

View 3 Replies View Related

Queries :: Filter Data From A Table Using Query (from Data Input Form)

Dec 30, 2014

I would like to filter data from a table using a query (from an data input form). The objective is to output all results if input form field is empty and to output results higher or equal to the type in the field if field is not Null. The query code is as follows:

IIf(IsNull([Forms]![Form2]![MaxDiffInput]);[Maximum operational pressure (bar)];[Maximum operational pressure (bar)]>=[Forms]![Form2]![MaxDiffInput])

However, is not providing any result when the input field (MaxDiffInput) as a value.

View 5 Replies View Related

Inserting Data From One Form To Another Using A Query In A Form

Sep 6, 2004

HI

I have a form for member details that comes from the member table and I want to
include a button on the form that will remove the member details from the member
table to a member history table and then delete the details from the member table.
When moving the record I also want to include details from another table called 'promotion',
this table is linked to the member table via the member ID (Foriegn Key).

Firstly I want to know if this is possible and if so how I would achieve this. I am having
trouble getting the SQL query to identify the current record that the form is displaying so I can
select additional information and move it into the Member History table.

Any information would be greatly appreciated.

Thanks.

View 2 Replies View Related

Getting Data Into A Query From A Form

Jun 28, 2006

I want to run a query from data I enter on a form.

On the form I would have a field where I could enter data to search for.

How do I get the Query Critera from a form?

KMB
Thanks

View 2 Replies View Related

Running Query With Form Data

Aug 31, 2006

I have a form that has a start date field and an end date field and a client ID field. When I click a button to run a query I want the query to take the start date and end date and filter the query on those dates and also only supply data for the client ID

at the moment when I run the query i manually type the start date and end date and then scroll down the client ID to the one I want.

any ideas how to do this from the form

many thanks

View 2 Replies View Related

Passing Form Data To An Sql Query

Nov 15, 2005

I have a hidden field on my form called "key". I can reffer to it as [forms]![MyForm]!key Is that right?

I also have a subform on this form that uses an sql query. I want this query to match on the key from above.

Shouldn't this work? select field1, field2 from table1 where keyvalue = [forms]![MyForm]!key

It doesn't. It returns a blank record.

Any help would be greatly appreciated.

View 1 Replies View Related

Access 97 To 2003 Using Form Data In Query

Dec 12, 2005

I was just converted from 97 to 2003 this weekend. I have a query set up that links a field to a form to get the date entered in the form into the query. For example if I enter 12/31/04 on the form and run my query it is put in the field 12/31/04. But in 2003 it is just blank. The formula I used in 97 is

StartDate: [Forms]![Cash Flow]![Start Date]

Is there something new I should be using to get that to pull in?

View 1 Replies View Related

Linked DB Query Which Allows Editing Of Data Through A Form

Dec 20, 2005

Hello,

I am a relative newby to Access, Can someone please offer a solution to my problem.

I have a DB which lists current order references, I also have a linked spreadsheet from a customer which references their Ref number to our S/order no & Item no.
I have set up the relationships for the common data between both tables.

if I create a Query from either table individually the data can be edited but when a query is created from both sources the data cannot be edited.
this also happens if the spreadsheet is imported to its own DB.

I would really like to create a form which displays both sets of data for editing, marking progress etc.

Can data from linked tables be edited in a form ?

Regards

Andy

View 6 Replies View Related

How To Modify Data Retrived Form A Query !?

Mar 27, 2006

i am very rookie with access.. infact i am doing my first project in access for a friend.. here is my doubt...

this frnd has toy making business.. he wants to keep track of this inventory... i have made one table (ItemId(PK), Item descripstion, noOff, parentItem(FK), stock)..
noOff is the no of child items required for a particular parent item..

now i have to run a query to get all the items which have same parentItem.. for this i designed a form... have put 3 text boxes and a subform.. one to accept the parentItem.. 2nd to display its description.. 3rd one to accept no of parent items which i wud be the multiplying factor for the child item noOff.. (default is one..)

http://img.photobucket.com/albums/v355/sledge045/171205/form_prd_data.jpg

now i can retrive the parentItem id.. from the form and use it in the WHERE clause...


SELECT ItemData.ItemID, ItemData.ItemDescription, ItemData.noOff
FROM ItemData
WHERE (((ItemData.ParentItem)=[Forms]![Display Product Data]![txtProdId]));


but i want to retive the value in the No off: box and multiply it to all the child item's no off...

i have tried to multiply ItemData.noOff with [Forms]![Display Product Data]![txtNoOff] but did not got the desired results....

i need help with this... or if u know ne other way to do it... plese post a reply... thanks...

View 1 Replies View Related

Append Query To Add Data From Form To Table

Mar 24, 2008

I understand that I can use an append query to add data to a table from a form and then have it run by using a command button. I want to do this because when I link the form directly to the table I do not want the form to create a new record every time it is invoked. (it does this automatically because I have visual basic code move to acNewRec and fill in some of the fields on load and lock them off, this is neccessary) I also do not want it to create the record immediately because the user might then decide to cancel their actions and leave the form - then I have half a record's worth of data in my tables! :D

I could just use VB and recordsets to do it but SQL is more elegant. The problem is, when I use the append query it appends an extra record to the table for every single record that already exists within it. So a table with 1500 records will have 1500 new entries containing duplicate data!

This is all a mess, so what would be a better approach? The user does not need to navigate through the records on this form or make edits, it's strictly for additions. There is a subform linked to a table that is in a one-to-many relationship with the table that the parent form must update to, but I'm quite happy to leave that one linked directly.

Any suggestions appreciated ;) I've probably done something thick..

View 1 Replies View Related

Forms :: Display Data From Query Into Form

Mar 19, 2013

Display data from Query into Form..I am attaching the database dbtest.zip which contains a table, couple of queries and form.I have done what ever settings I could after going thru some tutorials / discussion forums online, but to no avail.

All that I want is, when I open the form "frmtest" in "form view", and select CS in Combo 8, the corresponding fields in the form viz Item name, Sl No and System Name should get updated on the form. I want to view it in "Single Form" format.

View 1 Replies View Related

Forms :: Display Query Data In A Form

May 12, 2015

I have a form that displays employee details. I've also created a query that calculates the current age of all employees and updates automatically. I've also created a subform that displays the query data.

My question is, how do I get the query data to display on my main form? Can I do it directly from the query or do I have to use the subform? There are multiple columns on the form and I want to add it as a new column that displays the same as the rest but continues to update automatically.

View 9 Replies View Related

Forms :: Getting Data From A Query For A Field On A Form

Mar 3, 2014

I have a database I use for tracking IT problems (tickets). The form I use has a field to select who the ticket was opened by. To select this, I created a query that shows only active contacts (users) and set the opened by field to use this query to select the user. It works great except for the fact that once a contact is no longer an active user their name on the opened by field is blank and no longer shows on any old tickets they had. Their name is still associated with the ticket though. I know this because I have the opened by field set so when it loses focus it opens the contact record (form) of the user so that we can update their data. So I find it weird that the opened by field on my old historical tickets wont show the name of a user who is no longer with us but the field itself knows who it was and brings up the contact form for the non active user after lost focus.

View 1 Replies View Related

Query That Prints Min/max Value From Data Gathered By Form Combo Box

Apr 4, 2006

i have a query that prints records from 3 different tables that match values entered through a combo box on a form.

here is the code (i know its messy):

SELECT Host_Countries.HostCountryName, Guest_Countries.GuestCountryName, Census_Data.ForeignBornTotal, IIS_Data.IISData, CoE_Data.ForeignCitizenship

FROM ((Host_Countries INNER JOIN (Guest_Countries INNER JOIN Census_Data ON Guest_Countries.GuestID = Census_Data.GuestID) ON Host_Countries.HostID = Census_Data.HostID) INNER JOIN IIS_Data ON (Guest_Countries.GuestID = IIS_Data.GuestID) AND (Host_Countries.HostID = IIS_Data.HostID)) INNER JOIN CoE_Data ON (Host_Countries.HostID = CoE_Data.HostID) AND (Guest_Countries.GuestID = CoE_Data.GuestID)

WHERE (((Host_Countries.HostID)=[Forms]![frmHostForm].[cboSelectHost]) AND ((Guest_Countries.GuestID)=[Forms]![frmHostForm].[cboSelectGuest]));


what i want it to do is to print what it shows, but then also have it print me the min and max values (the range of the data) in a new column as well. is this even possible? does anyone know what i mean? any help would be greatly appreciated.

View 2 Replies View Related

How Do I Update Data Related To A Read-only Query On A Form?

May 22, 2006

Hi all, I'm so tired of looking... please help me!!

I have an Access Data Access Page based on a query which is not updatable.

The query is based on a many-to-many table (e.g. OfficeProducts with foreign keys for OfficeID and ProductID and an Amount field). The query is not updatable as I have included outer joins to the Office and Product tables to get all their records back.

(I'm not sure if I've done this the best way, but need to be able to list all the possible Products for each Office whether they use them or not.)

I want the user to be able to update the Amount field, so e.g. if it is currently set to 50 to be able to change it to 40, or if it is currently null (as there is no record so far for that OfficeProduct) then to insert a record into OfficeProducts with the OfficeID, ProductID and Amount value entered.

I thought this would be straightforward by creating a new textbox in the same section as the current Amount field, calling it NewAmount and letting the user update this, fire an event trigger to either update or insert into the table, and refresh the query and record on the form/DAP so that Amount shows the newly updated/inserted value.

I have been searching for ages... cannot locate either the best event or events to use for this nor the code to enter!! Please please help!!!!!
(This is actually for a charity helping people suffering from emergencies in developing countries, not OfficeProducts, so your spot in heaven will be reserved if you can help ;) Thanks)

Jen

View 4 Replies View Related

Queries :: Parameter Query Using Form To Collect Data

Jun 24, 2015

I have a parameter query using a form to collect the data. I put LIKE and wildcard enclosing the parameter to bypass the criteria if the data box is empty. It works well. I have another parameter of date type that uses between two dates. How can I bypass the criteria if I leave the data boxes blank?

View 8 Replies View Related

Queries :: Using Form To Filter Data In CrossTab Query?

Jul 27, 2013

problem when I am trying to use Form to filter data from a cross tab query though I have already defined the parameters. The SQL is as under :

//Code start
PARAMETERS [FORM]![START_MONTH] DateTime, [FORM]![END_MONTH] DateTime;
TRANSFORM Round(Sum(CLng([A_GAS_m3]+[NA_GAS_m3])/1000000),3) AS GAS_MMSCM
SELECT maindata.on_off, maindata.state, maindata.OPERATOR, maindata.field_block
FROM maindata RIGHT JOIN PRODUCTION ON maindata.field_block = PRODUCTION.FIELD_BLOCK
WHERE (((maindata.field_block)<>"Panna" And (maindata.field_block)<>"Mukta" And (maindata.field_block)<>"CB-ONN-2000/2(NSA)" And (maindata.field_block)<>"CB-ONN-2000/2(BHEEMA)") AND ((PRODUCTION.MONTH) Between Format([FORM]![START_MONTH],"dd-mm-yyyy") And Format([FORM]![END_MONTH],"dd-mm-yyyy")))
GROUP BY maindata.on_off, maindata.state, maindata.OPERATOR, maindata.field_block
ORDER BY maindata.on_off, maindata.state, maindata.OPERATOR, maindata.field_block
PIVOT PRODUCTION.ACTIVITY;
//Code End

When I save it prompts for the Start and End Month and When I run the query it pops up the form twice...

View 1 Replies View Related

Modules & VBA :: Query Data Using Multiple Criteria From A Form

May 29, 2014

I have a form where varying layers of information can be entered. In some cases, a user may know all information or only part. If i tie the query to the form, each field has to be populated for it to work. how do i set the query up to effectively use the information available and not require all information?

I have tried setting VBA code as follows:

If Me.Combo1 = Null Then Me.Combo1 = "*"

However, when i do this, it updates the form field with an asterick/wild card but does not include in query. yet, when i update the form fields with data (not asterisk/wild card) the query runs.

View 13 Replies View Related

Modules & VBA :: Passing Data From Query To Textbox On A Form

Jan 7, 2014

I have a form with a date field, when the user creates a new record, I would like the date field to automatically fill with the most up-to-date date from the Orderdate table.

Basically I need the code to do the following when a new record is created;

Search the Orderdate table for the most recent date and then auto fill the date field on the form with that date!!!!

My thinking so far...

Private Sub Command34 - where would you set this event on the properties i.e. Before update or On Got Focus ?

Docmd.OpenQuery "QryFindMaxDate"

I'm not really sure how to pass the date to the text box on the form,

End Sub

View 7 Replies View Related

Using Form Data In User-Entered Query Search Criteria

Dec 20, 2006

I am attempting my first access database which tracks blood components in our medical facility. When a component is issued to a patient there is a button to push which links to a report that runs a query. The user must enter the unique key for the component at a promt, which ensures the report generated will be for that component only. My question is if there is a way to cpture and use that key automatically when pressing the button. If I need to clarify something, please let me know--I may not have the Access developer lingo down yet...

View 2 Replies View Related

Queries :: Form With Datasheet View - Trim Data In A Query

May 1, 2013

I am trying to create a form with a datasheet view that will show me all exceptions worked on all member accounts. I have over 10k members that each could have multiple issues (exceptions) worked on their account. I am using MS Access 2007.

Example: I have a member John Smith, with member id of 1234-00 that has multiple "exceptions" worked on his membership, say 5 database records for his account. My initial query I only want to see him listed once. I then would double click his Member ID to open all activity of his account.

I found the code below and modified it to fit my database and it brings me back the results I need for the above. However, if a material change is made on John Smith's account, his number is incremented. His number would be incremented to 1234-01. The next material change 1234-02, etc. I am looking to modify the code below, or another way to do it, that ignores the "-" and any numbers after it. The numbers before the "-" will never change. I searched and saw the TRIM function but couldn't get it to work.

Below is the code I'm using that has the correct names from my database. I have a primary key set up that increments and is tied to the exception, not the member id.

SELECT firstname, lastname, exceptionswrkd.memberid
FROM
exceptionswrkd AS base
INNER JOIN (
SELECT memberid, Min(id) AS which_id
FROM exceptionswrkd
GROUP BY memberid
) AS sub
ON base.id = sub.which_id;

View 3 Replies View Related

Queries :: Mismatched Data When Query From Main Form With A Count

Feb 9, 2014

I have Main Table with a count and I have a query from it. But when I looked at it, the data doesn't match. What may seems to be the problem? It is all Grouped By.

View 1 Replies View Related

Forms - Adding Query As Data Source In Existing Form?

Dec 2, 2012

I am trying to add a query in an existing form. When I click on adding a field, I get an option to show "all tables" for not queries.

View 3 Replies View Related

Queries :: MS Access 2010 - Put Month On A Form Based On Data In Query?

Mar 26, 2014

How do you put the Month on a form based on the data in a query?

View 1 Replies View Related

Queries :: Inventory Transaction Form - Append Query Data Type Mismatch

Dec 8, 2014

I'm receiving an error indicating there is a data type mismatch when running a query named qappInventoryTakeOn.

Data is entered into the Inventory Transaction Form. If the transaction type is "Take On", when the update button is clicked the record will be saved to tblInventoryMovements and then qappInventoryTakeOn should run to update tblInventory, but I keep running into the aforementioned error.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved