hi. i are replacing queries in my tables to get the database ready to convert to SQLServer.
Am having a problem replacing a query that is brings in a table for a drop down and inserting the selection in the record.
during creation, the record shows a date, id, task, hours.
the datatable needs date, id, task_code, task_name, task_job, hours.
On "task" the drop-down allows for selection of several choices that are 3 columns wide. i can get the columns to show but only the first column currently goes in my new table. the table's columns that the selection comes from is "task_code,task_name, task_job". All columns are needed as different areas use the same task code but use different jobs or names.
I was told to use a insert into statement, however am having problems with it.
have as follows:
SQLStatement = "SELECT [Task_code], [Job_name], [Task_name] FROM tablea; "
rec.Open SQLStatement, , adOpenDynamic
Can I use the append query to update a table by replacing all existing information with updated information while at the same time adding all data that isn't currently in the table?
Right now every time I run the Append Query it just adds the same information as a new row instead of replacing the existing row with the updated information.
I have a customer who made a query with a field that looks like that:
NewField: iif(Field1=True and Field2>100 and isnull(Field3);"Blue";iif(Field1=True and Field2>100 and not isnull(Field3);"Black";iif(Field1=True and Field2=100 and isnull(Field3);"White";... And so on, for miles and miles.
Although it works, and fast enough, I don't like the way it is displayed and I am sure that it could be even faster without all these iif.
Any idea about the best way for me to handle this kind of query? Thanks!
I have a main table which contains data on Oilfields. This is set up with an auto number for ID and a name of each oil field. I have other tables which contain things such as Pipelines, Wells and Platforms, which are linked back the the main table.
The problem is that the database was given to me with the links being between the Oilfield_Name, and not using the Oilfield_ID (which is not present in the 'satellite' tables). How can i add the oilfield_ID column to the 'satellite' tables so i can link them properly?! (i can obvioulsy physically add an 'Oilfield_ID' column to the 'satellite field', but how do i populate it with all the correct IDs from the main table, to suit what is in the 'Name' column of the 'satellite' field- does that make sense?). I suppose I need to replace all of the Names with the IDs?
This has been giving me such a headache. The Oilfields table has 2500ish records, with as many as 1200 in the other tables linked to it.
Hi, Im building a DB that basically tracks the hours people have worked, its all going fine apart from one major bug which i cant get my head around, I am trying to work out a way so that if someone decides to change the hours they have worked it replaces the existing record and does not create a new record.
Each record has a unique user ID attached and each day is dated, do you think this is a VBA solution or a change in the relationships perhaps?
Sorry fi there is already a similar answer to this question on the forum, but i couldnt find one!:confused:
Hi, I have 2 tables with similar data. However I need to compare this particular field called CompanyName in both tables. Reason being human error/exposition data errors. For example, Chef Kitchen Holdings Limited, in one table it is Chef Kitchen Holdings Ltd while the other table is Chef Kitchen Holdings Pte Limited, they both are the same but Access recognise them as 2 distinct datas.
Therefore I need help in comparing datas between these 2 tables for this particular field. So long as there is 75% similarities, one of the 2 tables will have the data replaced.
Is that possible using Access? if not, how about excel? please suggest.
OK, here is my situation. I have an access database which is updated automatically every night with new data. My companies solution to this is each morning, the entire database is downloaded to my computer to be used by another application.
In one of the tables, there is a field that doesn't work for my purposes, so each day I have to manually open the table, and change the contents of that field for every record. For example, lets say I have the following table:
I am having a query, where a few date records are null because of no entry or record, what a want that the field with no date entry to be come up with zero "0" .
I created a database that has a field called "Corrective Actions." I want the user to be able to type in a series of numbers, in the following format: 001, 002, 051, 123. Each number has a certain meaning. For example, 001 means "Upgrade to current revision," 002 means "Replace Unit," and so on. Here is what I would like to happen: The user will type in the numbers in the appropriate format. When the user presses the tab key to go to the next field, I want the numbers to be replaced with the actual meaning. My problem is that I can not figure out how to accomplish this. Can anyone help me?
Hi. I have a database which store the subject title of the mailto link using the upload form. I would like to construct a mailto link that picks up the suject title from my database. However, there are spaces in the subject and the mailto link cuts off at the first spacing. In my display page, I would like to replace the spaces with %20 but have had no success with any attempts.
This is the code that add the data to the database
I have a table (which has a few relationships) that contains 10.000 records up-to-date, but I've been making major changes to my database working on an old version from early June, when it had +9000 records.
What I'm planning to do to update the table:
export those 10.000 (up to date) records to a Excel file delete those outdated +9000 records manually (select all + supr) import the data from the Excel file so my new database is up-to-date again .
Is this acceptable or could lead to weird errors in the future?
I have info in Excel workbooks coming from various individuals. I take bits and pieces of data from each and the update an Access DB. Is there a way to simply replace the table in Access without affecting the relationships that the current version of the table has?
Is it possible to create the following logic in query:
"If there is a "SHIFT2" or "SHIFT3" value on the last Friday in month, then change the date values for these entries to the next date (Saturday)"
In the attached sample, there is a number of such values within the "Adv Track Shift" field dated on Friday 04/25/08 in the "shift_date" field. The logic should replace the applicable dates to Saturday 04/26/08. This should work for any month, regardless if it finds either of the two shifts or both of them.
i'm trying to do something that i thought would be pretty simple. what happens is i have 2 files that get used, one by access and one by excel. they are both the same, except if one gets modified then the other doesnt obviously. (theres reasons for having the 2 files).
anyway. in access i want it to pick the newer of the two files (i assume this is using a fso system object?), if the one it normally doesnt use is newer, it should copy the new one over the old one and continue using the one it normally uses.
i cant simply use the other file as another user always has that file open.
any sample code on how to check if things are modifyed at a later date? and copy/pasting using those fso objects?
Is there a way to over-ride the message box which is automatically generated when you use the Wizard button to create command buttons?
ie. When you create a button through the wizard to delete a record it says "You are deleting one record" is there a way to override that message and put another one
i look at the code but I cannot see where the message part is inputted.
I realise that i can probably write the code long hand but (always) looking for a quicker way.
My table (excel spreadsheet) sits on another directory from the DB. If I delete the table on this directory and immediately replace it with a table with the same filename, format, etc (only the data has changed) will each database user have to relink the table on their desktop DB? Or will the forms/subforms/reports still maintain their relationships/functions and just display the new data?
I have a module that creates records into a contacts table in my access database. When there is no data in the field from outlook, the data is populated as an empty string "" instead of a null value, creating problems with subsequent queries and processes. I'd like to create the data as a null value but the module keeps failing with "object is required" on the statement
It doesn't seem to like System.DBNull.Value or DBNull.Value, and when I assign the vbNullString constant instead, it gets set to "" again and not null.
I need to create a query that combines two columns (lets say Column A and Column B for example) however the problem is that whatever non-null values that are in Column B must replace any value in Column A. If Column B has a value that is null then Column A's value is shown.
I have an example of what I'm working with (access file) and what result I want (excel file).
I'm building a database to calculate yearly fees for customers. I have a list coming from our accountancy-database that shows a field with the clients name & surname combined and I have a table named 'customers' that contains the clients names & surnames as separate values.
The first table (let's name it "accountancy") thus contains a field "Customer". Example data in this field:
The second table ("customers") contains the fields "ID, name, surname". Example data in this table:
1;"John";"Doe" 2;"Marcy";"Free" 3;"John";"McLane"
Now, what I'm looking for is a way to replace the 'Customer'-field in the first table by a lookup field that contains the correct ID for that customer in the 'Customers'-table.
Lucky thing: there are no doubles in the customer's table, so no two customers have the same name AND surname.