Saving Value To Variable? (update/make Table Query)

Aug 28, 2007

I am trying to create a table to show the parent/child relationships between assemblies, sub-assemblies and detail parts. The table I start with has 2 fields a "Part Number" and an "Indenture".

Please forgive all the periods, couldnt think of how else to seperate the values to depict the tables.

Example:
IND..PN
00....A
01....B
01....C
02....D
03....E
03....F
01....G
00....H
01....I
02....J

I can get the first step to completeing the new table of parent/child relationship like this:

PN....00....01....02....03
.A.....A
.B....."".....B
C......"".....C
D......"".....""......D
E......"".....""......"".....E
F......"".....""......"".....F
G......"".....""......""....G
H......H
I......""......I
J......"".....""......J

Where "" are null values

My problem is making it so that every part number has its own array, aka [family tree], so that for part "F" the table would hold "A,C,D,F"

I though an update query where for example:
*"Zero" is a single field string.

IIF([00]<>null(), Save [00] to Zero, Write Zero to [00])

Would work but have been unable to find any information about passing a field value to a variable for later use or comparison. I would have already done this in excel if the table had less that 65000 records.


Example of final table:

PN....00....01....02....03
.A.....A
.B.....A.....B
C......A.....C
D......A.....C......D
E......A.....C......D.....E
F......A.....C......D.....F
G......A.....C......D....G
H......H
I.......H......I
J.......H......I......J

Any help is greatly appreciated.
BsK

View Replies


ADVERTISEMENT

Saving Record To Run Query & Update

Jun 14, 2005

Hi all,

I've got this form working ok but need to add some extra functionality but haven't a clue how to do it!

http://www.access-programmers.co.uk/forums/attachment.php?attachmentid=10175

The uploaded database has two main forms. The first is used to enter customer data, the second runs from a query and shows all those records that have been completed in the first form (frmCustInfo - AgentLog = Yes) but not completed in the second form (frmControlsSource - AnalystLog = No)

Then more data is input into one of the subforms (frmControlChecks). Now in order for me to see the results of the queries connected to two other subforms I have to move off the record and back to it (for the record to be saved and then the queries run)

After moving back to the record, the query results on the right (Information Only) are manually added to the last subform 'Input Two', then the user would move on to the next record and do the same.
-------------------------------------------------------------------------------------------------------------
What I need it to do then is this: When the user tabs off the last field in the subform (frmControlChecks), the queries to the right (two subforms) would run, showing the results and also populating the last subform (frmAnalystInput)

The user would then click AnalystLog and move to the next record.

I hope this is possible without redoing the forms/queries because it's taken ages to get this far

I've also added info in this sample database and some working data if you want to take a look...thanks for any help

View 1 Replies View Related

Modules & VBA :: SQL String - Update Query Using A Variable Value

Jul 22, 2013

I am currently trying to create an update query (building a SQL String in VBA for a command button click event) to update a variable's value into a table.

Basically, there are 2 tables, displayed in 2 sub froms within the same main form. (OldTable and NewTable for arguments sake)

The basic method I want to implement is that a user highlights a record in the subform of "NewTable". (This value is stored as a variable "NewJPNUM" This value is then to be inserted into the highlighted row (or rows) of table OldTable on command button click.

So the basic idea is a user highlights a row in one table and this value is stored as a variable "NewJPNUM" . The user then highlights a row or rows in "OldTable" and the value from variable "NewJPNUM" is then written to field "NewJPNUM" in "NewTable" on command button click.

I am not experienced with Access but have decent experience in Excel / VBA so not really sure of best practice methods etc.

View 3 Replies View Related

Modules & VBA :: Update Contents Of Variable But Not The Variable Itself?

Aug 20, 2014

I look at a lot of files to see when they were last updated. I wanted to write a generic procedure to manage that so ..

Code:
Public fDate As Variant
Public vField As String
Public vFile As String

'GTSdata
vField = "txt_gts_data"

[Code] ....

What I hoped Me.vField would do is update the date field [txt_gts_data] on my form with the date the file was last saved.

i.e. me. txt_gts_data = fDate

What actually happens is the variable vfield gets updated from "txt_gts_data" to 19/08/2014 then later code falls over because the fieldname is lost .

Me.[vField] corrects itself to me.vField (and does not work)
Me!vfield falls over (cannot find the field vField, not surprising J)

How do I say update the contents of the variable, not the variable itself?

View 7 Replies View Related

Update Query To Make Join Again

Sep 7, 2006

I need help with an update query. I download several data tables from SAP that I would like to join again in Access. I have set up an updae querry but not all the records are unique. I thought I had fixed this by using a flag to update to -1 processed when running the query and set the criteria on the flag 0 to process items. But the whole querry processes before setting the flags at the end and I want the flag to be set so that it excludes processed items when each line of he query is executed. Can anyone help?

View 1 Replies View Related

General :: Saving Data - Update Or Cancel Update Without AddNew Or Edit

Apr 13, 2013

My membership database has worked fine until recently. Now I cannot save inserted data. On attempted saving "Update or CancelUpdate without AddNew or Edit" appears.

The problem. relates to 2 tables Member and Addresses. PK in the parent table Member is ID. In the Addresses Table the FK is ID. There is a One to One relation between the tables and Referential Integrity is set. I know 1 to 1 is not good but it worked fine in this small database.

Browsing the all of the existing records is fine.

View 9 Replies View Related

Saving Query Data Into Table

Mar 18, 2008

Ive created a query that asks the user to enter data (month and year) before it can be processed. This is causing a problem for me as i need to produce a chart from this data and access isnt letting me (access doesnt like me asking the user to enter data). So i thought if the data could be stored in a table then the chart could be drawn from the table.is this possible.Below is a screengrab of the design view fro the query.

http://i30.photobucket.com/albums/c329/oohmygod831/screengrab-1.jpg

and this is the sql for the query

SELECT Shift.Shift_ID, Shift.Shift_Type, Sum(Main.Shift) AS SumOfShift, Format([Date],"mmmm") AS Expr3, Year([Date]) AS Expr4
FROM Shift INNER JOIN Main ON Shift.Shift_ID = Main.Shift
WHERE (((Month([date]))=[Month]) AND ((Year([date]))=[Year]))
GROUP BY Shift.Shift_ID, Shift.Shift_Type, Format([Date],"mmmm"), Year([Date]);

View 2 Replies View Related

Queries :: Name A Field In A Query Or A Table With A Variable Name?

Jul 19, 2014

is it possible to name a field in a query or a table with a variable name?

For example:

I want to choose in listbox "fieldname" the name of the field.

And the query field name looks like:

Code:
forms![testform]![fieldname]: FieldOfTheTable

Unfortunately it doesn't work.

Also if I save the choosen fieldname in a vba function.

Code:
fieldNameFunction(): FieldOfTheTable

This doesn't work, too.

View 14 Replies View Related

Extracting Data From Linked Db2 Table Using Access Make Table Query

Aug 29, 2006

Hi,
I am extracting data from linked db2 table using access make table query. First I create a select query and can view the linked db2 data, but when I change to a make table query I get an error message, "invalid argument", when I run the make table query. There is no selection critera specified. Has anyone had this happen? and Do you know a solution?

Thanks for your support
GinnyP

View 1 Replies View Related

If A Make-table Query Result Is Null, How To Have A Default Message Appear In Table ?

Jan 21, 2005

Hi everybody,

Beginner here needs help !

I'm building a make-table query for which if the result is null (no record correspond to the set of criterias), a default message like "there was no activity during the period" would appear in the table (not a message box...I need the message in the output table). The best I could think of is an IIF function but it doesn't seem to work... Is there any way to do this without using VBA?

Thanks in advance !

View 1 Replies View Related

Forms :: Adding Variable To Specific Row Of Listbox (Table / Query)

May 31, 2014

The VBA code I have at the moment:

me.Results.Rowsource = "SELECT car, title, FROM dbo_inventory"

Is it possible to add a variable to a specific row in listbox using the code above? In this case the price?

View 3 Replies View Related

Changing The Name Of The Created Table In A Make-Table Query

Sep 23, 2007

Dear Access Expert

I wanted to know if it is possible to change the name of the Table which is going to be created using a Make-Table Query via code (VBA).

For example if my Make-Table query currently creates a table with the name "Table1" I want to change it to name "Table2" and then change it Back to "Table1" or "Table3" etc.... depending on the users selection.

View 6 Replies View Related

Queries :: Make Table Query - Find Table Name

Oct 14, 2013

How can you determine the name of a table that has/is going to be created by a make-table?

View 2 Replies View Related

Make Table Query

Dec 22, 2005

When using a make table query, can you include an ID tag. in the output table? if so how

View 2 Replies View Related

Make Table Query Help

May 15, 2006

:confused: I am using a Make Table Query to filter a Linked Excel Table. Is there a way to cut/drop the first 8 characters of the text out of one of the fields as it creates the new table?

Field NameExcel DataFinal Data
Model_NameLATITUDE D600D600

Also, the final table has two Relationships with two other tables. When I run the Make Table Query once a week, I have to break the relationship to get it to run. Is there an easier way to dial with this?

View 2 Replies View Related

Make-Table Query ??

May 19, 2006

Is there a way in a Make-Table query to tell the table to open when it's created? I would assume there is a function or SQL code that would do this, but I know very little SQL. Can anyone point me in the right direction? Thanks!

View 2 Replies View Related

Make Table Query

Aug 27, 2007

I have a database named NewUpdate.mdb. I have another database named MainDatabase.mdb. Almost all the tables in NewUpdate.mdb are linked tables that are in the MainDatabase.mdb file.

I've written a simple make-table query in NewUpdate.mdb that makes a backup of a table that is located in the MainDatabase.mdb file. (See code below.)

SELECT tblProviderRate.* INTO tblProviderRateSave
FROM tblProviderRate;

The only problem is that this new table is created in the NewUpdate.mdb file. I need the query to be stored in the NewUpdate.mdb file and the "new" table to be created/stored in the MainDatabase.mdb file.

This sound simple enough, but I'm drawing a blank as to what I need to do in order for this to occur. Can someone tell me what I'm leaving out??

Thanks,
CRhodus

View 2 Replies View Related

Make Table Query

Nov 26, 2007

How to make-table query to make a certain field a memo field instead of a text field? The reason I cannot use the text field is the limitation is 255 characters while I require 2000 characters?

View 4 Replies View Related

Make Table Query

May 28, 2006

Dear friend

I need your help desperatly. In my db, I am making a "make table query" to match some text.

Help me build this please.

First a form which has text box, where I will put in some words..
Then a make table query, which will have =[form]![name of form]![control name]
A report on same table.

Means when some one puts some words in text field of form, on pressing hit button, a like statement is automatically created in one field of query which matches those words and a table is generated from them. Result is report.

Hope this is clear, could you please help me build this?

View 14 Replies View Related

Make Table Query

Dec 7, 2006

How can I set a button in an MSExcel sheet to run MSAccess make table query?

Please help. Thanks.

View 2 Replies View Related

Make-Table Query With Relationship To New Table

May 31, 2005

I've got a problem with a make-table query that creates a new table which is then populated with new values that relate back to the original table the trouble is the make-table won't run with that relationship in place.

Is there a way to delete the relationship then reinstate it after the query? or any other way round that someone can think of.

Thank You

View 1 Replies View Related

Make Table Query From Filtered Table

Jul 31, 2007

I have come across a snag in my access project I am currently undertaking and need some advise on what should be done next. . .

In a nutshell, this project's primary purpose is to perform a search on a table of information based on many fields and generate a report based on the records which match the search. I have the search form working (similar to this one here) http://allenbrowne.com/ser-62.html

It displays the results from the table based on the search criteria. The form is great for viewing the results which match search criteria; however, I am having trouble doing anything else with the data (perform operations on the data, send the results to the table, etc. . .). How should I go about moving this data to a table?:confused:

View 3 Replies View Related

Make Table Query - With Date In Table Name

Aug 20, 2007

I have used/am using the "INTO tbl_temp_copy" to create a temp table from a query called tbl_temp_comp. Everytime I run my query it deletes and then creates a new table with the same name - and this is what I have been wanting.

However now I would like to create a table with the date in the table name so:- "INTO tbl_temp_copy_Date()" but obviously this does not work and I do not know if it is even possible?

Anyone able to do this or know that it cannot be done?

View 1 Replies View Related

Make Table Query In A Report

Oct 31, 2005

How can I get a make-table query to run in a report?

View 6 Replies View Related

Make-table Query Property?

Apr 19, 2007

I am having trouble with a make-table query. I run a query that populates my website with data daily. I have a bunch of fields in the db that I wanted to be displayed as one field on the website, so in my query I concatenated them. My website is able to distinguish which fields are text and which are memos so I can display multiple lines. Everytime I run the query, it creates the concatenated field as a text field. Is there a way I can default this to a memo type?

Thanks.

View 1 Replies View Related

Make A Table From A Crosstab Query

Aug 24, 2007

I want to make a table from the results of a crosstab query and am struggling to find a way. Is this possible?

Any help gratefully received!

View 9 Replies View Related







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