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.
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:
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.
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.
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?
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.
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..)
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...
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..
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.
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.
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.
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.
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)
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?
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...
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.
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,
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...
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;
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.
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.