Updating Queries Dynamically

May 23, 2006

Hi Guys

my database is essentially a questionnaire of around 200 questions. I'm trying to add a 'light' version to it.

I've added a 'include in light verion' tick-box to all the questions and a 'light analysis' tick box on the registration page.

The questions are all genertated via queries pulling out the appropriate ones as required. What I'm tying to do is add to these queries so that if the 'perfomr light analysis' tick box is ticked only those questions that have been indicated as light are included, and if it's not all teh questions are included.

I can do either-or but not both dynamically

Can anybody help?

Thanks
scube

View Replies


ADVERTISEMENT

Dynamically Updating Combobox

Mar 27, 2006

sorry if this q has already been asked, but i couldnt find what im looking for after searching..

i have a main form. there is a combo box that is that is bound to tblSupplierDetails. this combox displays the records stored in tblSupplierDetails fine. now beside this combobox i have a hyperlink that opens a subform called 'subfrmAddNewSuppliers'. this subform works correctly - ie. when details are entered here, they are stored in tblSupplierDetails

my prob is that if the user adds new supplier details via the subform, these details do not appear in the combo box for the user to select when they are returned to the main form.. they appear if the form is restarted

Ive inserted the statesment Me.ComboBoxName.Requery (with ComboBoxName ammended) into the event procedure for After Update for the combobox.

however, with this the new details which are added via the subform are replacing the previously added record - so theres only ever one record in tblSupplierDetails.. can someone pls help me with this?

View 7 Replies View Related

Dynamically Updating Characters Typed

May 11, 2005

I have a form, very basic.. it contains more or less an inventory frontend in which users input computer equipment that we carry in our state dept.

To make this very brief, in my form at the end I have an "Additonal Information" textbox in which users can add additional notes, comments, etc.

As textboxes are constrained to 255 characters, I chose to show an additional textbox directly below the Additional Information textbox, with a control source set to =Len([Additional_Information]) to show users how many characters they have typed.

What I'd like to do though, is make this value dynamically update while the Additional Information textbox is still in focus... so far, all I can get it to do is update once a user has tabbed away from the additional information textbox.

Is there a way to make this update in real-time?

I appreciate any feedback at all.. thanks :)

View 2 Replies View Related

Updating Oracle Backend Tables From MS Access Forms(dynamically)??

Feb 13, 2007

Hello,

My requirement is this...

I have to use MS Access as front end with ODBC connection to Oracle 9i

DB.

The application(forms) should be able to update, delete ,insert records into oracle tables(backend).

i have a main form,which has some unique id's and other info about the ids and the subform shows several matching id's for that unique id in main form. the user who uses this application should be able to
1) search for the unique id in the main form such that the subform displays all its matches
2) they should be able to select anyone match and say approve(there can only be one match), then that particular record should be updated in the table.IF I USE A CHECK BOX AND IF THEY CLICK ON ONE RECORD AS MATCH,HOW
DO I TAKE THAT RECORD SAY THE ID , NAME ADDRESS AND ALL DETAILS AND UPDATE THE TABLE???
similarly when they select some other record i should give option of deleting other irrelevant matches in the backend table.

the main form and the subform uses the same table as source.updates are to another table, i should also have to put entry into audit table about which record was deleted and which one inserted..

How should i do this?? i am new to MS access .VBA, any help would be highly appreciated!

Thanks so much!

View 1 Replies View Related

Forms :: Updating Form Properties Dynamically - Command Button To Display Mode

Apr 16, 2014

I have a single form which becomes either readonly or editable or addnew using a circular toggle switch. The toggle switch is activated by a command button and the caption of the command button is used as the display of the mode.

The SetAddModeBt is a separate command button that initiates the add mode. The problem is that various form or field properties when defined on the fly are not stored and they get lost when you open the form again. Look at the code below:

Code:
Sub tglEditBt_Click()
'-------------------------------------------------------------------------------
' Circular toggle button to change display mode of the form
' ReadOnly - Edit - Add
'-------------------------------------------------------------------------------
' On Error GoTo NotFound
Dim ForName As String
Dim strSQL As String
Dim FMode As String

[Code] ....

Here the first two cases fail when executing the last statement saying it is not supported.

View 5 Replies View Related

Queries :: Use Inserted Value Dynamically At Run Time

Oct 16, 2013

I am inserting a new record into a 'master' table. Primary key is generated using a sequence. Now using that newly inserted primary key value, I need to insert a new record in child table. These 2 insert queries need to run at the time of deployment. how shall I store that primary key in a variable so that I can use it immediately in next insert statement?Can I use a returning into clause?

View 2 Replies View Related

Queries :: How To Dynamically Compile Where Clause

Sep 16, 2013

Is it possible to have a dynamic whereclause to a query?

I.e. one that is generated by a Function?

E.g.

Code:
SELECT a, b, c
FROM MyTable
WHERE GetWhere()

GetWhere will then return a string like 'a > 3 AND b < 3'

I have tested this scenario and it is not working, so maybe there is some work around?

View 4 Replies View Related

Queries :: Create A Query Dynamically From Vba Using A CreateQueryDef Statement?

Nov 19, 2013

I can create a select query with a combo box in it by changing the property of one of the fields - making the display control to combo box and adding the values. No problem there.

What I want to do is to be able to create a query dynamically from vba using a CreateQueryDef statement.

The problem is that you can only pass an SQL string to CreateQueryDef, and the combo box values are not part of the SQL code, but are saved with the query (presumably the same way column layout gets saved).

Is there a way to create a query with VBA and include non-SQL layout criteria so I can have combo boxes?

I'm using Access 2002.

View 6 Replies View Related

Queries :: Dynamically Add Fields To SQL Or Query Based On Form Selection

Nov 6, 2013

Is it possible to add a field (i.e., variable) to a query (or SQL programming) based on a form selection?For instance, if I use a form to allow an end-user to specify which fields they wish to include in the query (essentially creating a UI for the query builder), how would I go about creating the query/SQL or updating the query/SQL?

View 3 Replies View Related

Updating A Mulitple Queries

Nov 10, 2005

Hello I am new to Access and slowly finding my way round.

I have built 30 queries which eventually build two Union Queries of which each query as a slight different criteria.

In all 30 queries there is an indentical Field name called Arrived. What i want the user to be able to do is change the criteria in the Arrived figure throught a message box. So far the criteria is in the field is:

>=date()-3

This will show me everything 3 days ago. What i want to do is to let the user check what happened 5 days ago 10 days ago. I know i can create the following to solve the message box:

>=date()-3-[Enter in the days less than today]

Is there away to update all 30 queries at once with the same code?

View 3 Replies View Related

Updating Data In Queries

Jan 31, 2005

Each month I get 20 new tables to query data from. The field layout for my query is the same each time, with about 40 fields in total. Because this is the same query each time (and only the data in each table changes), how can I best set this up. I.E. each time I run the query, I have to go back in to the design view and select the new table for each field (in this case, update all 40 fields with the new table name). Surely there is a quicker way to do this.

Thanks,

View 3 Replies View Related

Updating Reports And Queries

Sep 27, 2006

I am updating an existing distributed access database.
I have made changes to an existing report (from my workstation - I have admin rights on the DB). The changes show up on the database. However when a client generates a report, the changes do not show up. What can I do??

View 4 Replies View Related

Queries :: Updating Table From A Query?

Jan 6, 2014

I have a table and a query both of which have the same [Resource ID], [Resource Name] fields.

I am trying to update the [CBL_1_Date], and the [CBL_1_kW] fields in the table with the [CBL_x_Date] and [CBL_x_kW] fields of the query. The problem is that when I try to run the query I keep getting "Operation Must Use and Updateable Query" error.

here is the SQL Code

UPDATE tCBLAggregation
INNER JOIN qBestof4CBLs_avg
ON (tCBLAggregation.[Event Date] = qBestof4CBLs_avg.[Event Start Date]) AND (tCBLAggregation.[Resource ID] = qBestof4CBLs_avg.[Resource ID])
SET tCBLAggregation.CBL_1_Date = [qBestof4CBLs_avg].[CBL_x_Date], tCBLAggregation.CBL_1_kW = [qBestof4CBLs_avg].[AvgOfCBL_x_kW];

View 1 Replies View Related

Queries :: Updating A Large Table?

Mar 1, 2015

This really isn't a large table by Access standards, as it has only about 1 million records, but nevertheless it's taking a long time to run the update query. Here's the query:

UPDATE [Db] INNER JOIN [Small Table] ON [Large Table].text1=[Small Table].[text1] SET [Large Table].[text2] = [Small Table].[text2];

[Large Table] has about 1 million records and [Small Table] has 10 records.

View 9 Replies View Related

Queries :: Updating Table With A Count Or Sum

Aug 15, 2015

i am trying top create a stock take form. the form is now set up so each time an item is scanned a new record is created in the tblStockUpdate. i ow need to create an update query that updates tblItems with the correct quantities.

the relational data will be the barcode and is unique to each record in tblItems. because each time an item is scanned a new record is created i need to count records grouped by barcode or sum as each new record has a 1 as default in the qty column.i have created a qry that sums the records by group(Barcode) but now i need to update the tblItems quantities. update queries have always troubled me and this one is beating me at present.

View 3 Replies View Related

Queries :: If Statement Not Updating In Query

Jun 23, 2015

I have a query based on a table that has a column called Calculated Card Expiration:

IIf([Card Type Issued]="PIV",[Issue Date]+1095,IIf([Card Type Issued]="Non-PIV",[Issue Date]+1095,IIf([Card Type Issued]="Flash",[Issue Date]+365,Null)))

It worked fine when I ran the query the first time, but now when a Card Type Issued and Issue Date is added or changed it doesn't work.

View 5 Replies View Related

Queries :: Updating A Table Using Wildcards?

Jun 21, 2014

Is it possible to update vlues in a table using wildcards. I want to use a query to search for certain records that meet a certain criteria and modify these values like changing particular dates in the date field to new values.

View 1 Replies View Related

Queries :: Updating Lines In A Query

Sep 26, 2013

I have created a query which is based on 2 tables.I now want to use the query to update content as needed in one of the tablesWhen I try to do this it says, Operation must use an updateable query..I used the update feature but it still says must be created in updateable query.

View 4 Replies View Related

Queries :: Updating Table Through Query

Aug 9, 2014

I'm working on a project management database for my fathers small business. Data Entry goes as follows: Users enter a Work Order, and all the parts that must be created for that work order. The parts have different processes (tasks) done to them to be created. The database runs a simple system like this as we want it to work. I am now attempting to allow handling of more advanced work orders. Specifically, some parts require the completion of multiple other parts before they can be created.

Here is how the database should handle these events:

1) User clicks button named "requires other parts" when entering a new part.
2) On click a subform is opened that allows the user to enter which other parts need to be completed first.
3) Once all of the parts are completed the next part can begin.

This is my current solution:

1) A query calculates if a part is complete
2) Some form of logic looks up to see if all the required parts are completed. If the answer is yes, a field named ready changes to "Yes" and if the answer is no, a field named ready changes to "no"

View 9 Replies View Related

Queries :: Updating First Row Of Duplicate Records

Jan 30, 2014

I have two tables -say Table A and Table B.

Table A Table B

ID userno ticketno Status userno ticketno Status
1 1211 YAB 1211 YAB LIVE
2 1211 YAB 1232 ACE LIVE
3 1232 ACE 1232 AAT INVALID
4 1232 ACE
5 1232 ACE
6 1232 AAT

I am trying to write an update query in MS Access that will update only the first record of any custno with the status so that my final table A looks like this:

Table A

ID userno ticketno Status

1 1211 YAB LIVE
2 1211 YAB
3 1232 ACE LIVE
4 1232 ACE
5 1232 ACE
6 1232 AAT INVALID

How to write the query.

View 3 Replies View Related

Queries :: Updating Other Field Values In Table

Apr 14, 2014

I have a query that takes a value, Proposalvalue, and depending on the currency, loc curr, it calculates the currency. It gets the currency value from the currencies table and appends to TableB

eg.
proposalvalue currency
50000 1

Currencies
id Value
1 0.6587

This creates the conversionvalue = 32935 in the TableB.

I have a form that can viewedit the data in TableB.

Using this form, I want to be able to change the proposalvalue and for it to automatically update the conversionvalue.

View 2 Replies View Related

Queries :: Data Comparing And Updating Incorrectly

Apr 17, 2013

I have 2 tables one Access, one FoxPro both containing similar information. The idea of my query is to compare both tables and update the Access table if the value in the FoxPro table has changed. This works fine for a number of similar queries that I have. However, intermittently, this query will see two values as different when they are exactly the same and replace the value in the Access table with a seemingly random value. I know the "Random" values are from other records within the table but cannot see any link between the values.

View 2 Replies View Related

Queries :: Updating / Adding New Records To Existing Tables

Jul 29, 2014

I have a table with more than 60 fields and need to update it with records from another Access file with a table with an identical data structure.

Is it better to run an update query or an append query (i would have to delete the original records in the target table first) or a union query?

If I run an update query I will have to manually add each field to the query.

The update query will not add 'new' records. If I run an append it is quicker because I can use the * to match all fields, but i will have to delete the 'old' records first, as both tables use autonumber for the PK so the PK ID will be the same in each table (will get a key violation error).

If I import the 'new' table and run a union query it will match the fields and add the new records, but then i will have to create new table from that query.

View 1 Replies View Related

Queries :: Updating Dates - Query Turned Read Only

Mar 28, 2014

I have a query that i use to update dates relating to jobs and at what stage of development they are in. It worked fine until I started to pull in some data (Prism) to update the user when the project is planned in to sample and when mass production starts (the field this is displayed in is not enabled). when I've incorporated this it I have no longer been able to update any field and my query has turned read only.

SELECT dbo_NPD_Container.PENumber, dbo_NPD_Container.JobNumber, dbo_NPD_Container.ProjectTitle, dbo_NPD_Container.Status, dbo_NPD_Sales.InitialQuery, dbo_NPD_Sales.InitialQueryDate, dbo_NPD_Sales.SpecificationIssued, dbo_NPD_Sales.ApprovalRecived, dbo_NPD_Sales.TuDrawIssued, dbo_NPD_Sales.TuDeliveryDate, dbo_NPD_Sales.TrialRequestIssued, dbo_NPD_Sales.SampleDate,

[Code] .....

View 2 Replies View Related

Queries :: Inserting And Updating Based ID In Main Table

Sep 29, 2013

I have add my two tables

Main table calls Attack
Sub table calls Research

the main table attack is linked with sub table Research by Attack.ID and Research.attack_id from form automatically

The sub table Research have more than one record which is linked into the main table Example:

How can I get the data which is marked in blue into record 24 and the data marked in Red into row 23

using Unite_Equal column?

View 3 Replies View Related

Queries :: Copying / Updating Data From A Database Table To Another

Jul 28, 2014

I have a MS Access table containing Dependent social security numbers but some of the dependents social security numbers are blank.

I have a MS Sql Database that contains a table with most of the missing MS Access table dependents Social Security numbers.

How can I take the Dependents social security number from MS Sql Database and copy/update the MS Access table.

I tried the sql code below created from MS Access and it matches 453 records out of 460 dependent social security numbers but how do I update qryGHIAccuracyFile_MissingDepSSN.SSN with the social security number from dbo_depfile1.dep_depend_ssn

Code:

SELECT dbo_depfile1.dep_depend_ssn, qryGHIAccuracyFile_MissingDepSSN.SSN
FROM qryGHIAccuracyFile_MissingDepSSN LEFT JOIN dbo_depfile1 ON qryGHIAccuracyFile_MissingDepSSN.MemberSSN = dbo_depfile1.dep_ss_nbr
WHERE (((dbo_depfile1.dep_first)=[FirstName]) AND ((dbo_depfile1.dep_last)=[LastName]));

Updating MS Access table dependent blank SSNs with SSN in MS Sql Database.

View 2 Replies View Related







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