Hi.
I have a form with two text boxes, call them FIRSTNO and LASTNO.
The user inputs a first and last number into these boxes, and what I want to do is append to table NOS all integers between these two.
E.g. user inputs 6 and 11 and I would like table NOS to contain 6 rows, with the first field containing this number, like so:
6
7
8
9
10
11
It sounds easy, but I’m struggling!
Any thoughts appreciated. Thanks in advance.
I currently have a calculated field that will result in either a whole number or a decimal. From there, I need to set up a field that identifies if the previous field is either a whole number or a decimal.I have tried several different formulas, but always seem to get an error or a query that does not return any results.
I need to be able to precisely handle nonnegative integers (in the math sense of integer, not the VBA sense, of course) between the values of 0 and 808,035,046,350,570,000. (Don't ask.)
I'm wondering whether I should be handling these numbers in a string and do everything manually, or whether the datatype Decimal or Variant will work for me.
I read that Decimal handles +-79,228,162,514,264,337,593,543,950,335 with no decimal point, or +-7.9228162514264337593543950335 with 28 places to the right of the decimal.
I absolutely cannot have the "rounding type errors" and "oddities" that you get by storing integer values in doubles, for example, due to imprecission.
Seeing that Decimal seems to work in a decimal point manner worries me, that perhaps I shouldn't be using it for this scenario. However, it's range seems so much larger than what I need, I'm wondering if I would "get away" with it.
If needing no imprecission to creep in means that I have to use Strings and implement my own String math library, that's the route I would have to go.
Question 1 - If I need the numbers to be exact (again, nonnegative integers, no decimal points), do I need to use a String, or should I use a Decimal or Variant type?
Question 2 - What is the difference between Double and Variant, for the purposes of storing numeric values? I read that Doubles are 8 bytes, and Variants are 16 bytes, however the Variant description is "Any numeric value up to the range of Double", which confuses me since it's double the size.
I have a query which returns, among other things, a number of boolean fields. In some cases, there will be a genuine True or False value in each of these fields; in others, it can and should be Null (e.g. as a result of a 'failed' LEFT JOIN of some description, where there is no associated record in the joined table which fulfills the criteria)
So something like this :
Code: SELECT [tblTable2].[fldBooleanField].... FROM [tblTable1] LEFT JOIN [tblTable2] ON [tblTable1].[SomeID] = [tblTable2].[SomeID]
However, I will be writing the result of the query to a text file and here's the problem. I want to show a numeric value for a genuine True / False (i.e. -1 and 0 respectively using the standard boolean conversions in Access) and a blank for any Null values.
So I tried this :
Code: SELECT CInt([tblTable2].[fldBooleanField]) AS fldBooleanField.... FROM [tblTable1] LEFT JOIN [tblTable2] ON [tblTable1].[SomeID] = [tblTable2].[SomeID]
However, currently when I look at the exported recordset in Notepad, I am getting 0's for both False and Null values (and -1 for True)
How I can adapt my query to keep Nulls...null? And convert the genuinely present boolean values to integer form?
Only thing I can think of is to use (untested) :
Code: IIf([tblTable2].[fldBooleanField] Is Null, Null, CInt([tblTable2].[fldBooleanField]))
But there's a number of boolean fields in there, all requiring the same treatment.
Is there a way to append a pivot table to a table or possibly make a query based on a pivot table? I need to get a count of Part Numbers and I need the average price for all these parts. Additionally I want to ignore a count of less than 3.
Also I am having trouble filtering on the count in the pivot table... haha, so I was gonna Query on it later on.
I am rebuilding an application for a client and I have an Access table that I am using as a temporary table. Once the user is done entering information into the temporary table through a form, the user presses an update button that appends the records using an Append Query in Access to an SQL Server Table.
The following error message occurs:
"ODBC -- insert on a linked table 'linked tblname' failed.
[Microsoft][ODBC SQL Server Driver][SQL Server] Explicit value must be specified for identity column in table 'linked tblname' when IDENTITY INSERT is set to ON. (#545)
I am using a form, subform combination to record a bill with many details. The bill summary is posted into a tbl_TransactionsMain table in SQL Server using the ADO AddNew method. The PK for the tbl_TransactionsMain is then entered into the temporary table in Access. When the temporary table records are appended into tbl_TransactionDetail the error message occurs.
What is also interesting is while typing out this post I thought to test the error by manually trying to run the query. The query worked like a charm! :confused: When the orginal error occurred off of the form I tried to run the query manually and it failed. I am guessing that this might have something to do with the ODBC timeout.
I think SQL Server/ODBC connection is not liking how I have a set of records in an Access table with foreign key numbers assigned when I am attempting to append the records. I am new to SQL Server and any ideas are most appreciated! :)
I have a fairly simple append query that appends two columns of data to another table - all good. Except, the destination table has a field 'ServiceDate' that I would also like to be completed at the same time with today's date. I presume that this is =Date(), but where do I put it to make this happen?
I have two tables, submit and imgdest. Submit is edited by front-end users to load pictures for back-end users who then delete the images when they're done with them. Submit is edited by a form, in the form I've placed a button (Command37) that has code:
Code: Private Sub Command37_Click() Call InsertData MsgBox "Completed", "0", "Completed Backup" Exit Sub End Sub Private Sub InsertData()
[code]....
This code was working for a short while, now anytime it's run I get error 3027 - Cannot update. Database or object is read-only. However, I can open the linked table and manually change information in it with no problems.
I have a database with existing tables.I now want to add a whole bunch of records into my access tables.A lot of the data is repeated, and lends itself to my doing it in excel with it's better copy and paste abilities, and it's ability to easily increment alphanumeric fields.I can't seem to succeed in append importing to the bottom of my access table from my excel spreadsheet. All columns are the same.Can this be done, and if so how please?I'm on XP Pro with Office 2003 Pro.I'm also very much a newbie in Access.
I have a form with a listbox that displays the name of a table. Once the listbox item is selected, the table name is set to a variable called myFile. I want append the records from the table (myFile) into another table.
how I could run an append query from table A to table B that only appends data that is not in table B.I want the primary keys of A to be exactly the same as B, because I will use B as a blank slate (another append query to append info to another table C with all the fields as 0 except for the primary key).
For example,
Table A - Supplier Table B - Things that supplier does (blank) Table C - Things that supplier does (information)
Lets say table A has 1,2,3,4 for supplier.Table B has 1, 2, 3, 4, as primary keys as well but all the other fields are zero.I insert PK "5" + data into table A through a data entry form, and then when I click on "save" in the data entry form, I want to macro an append/update qry (I don't know which one is supposed to be used in this instance) that will insert PK-5 into table B, so that I can append the blank slate info into table C.
I am attempting to append 2 fields from one table and one record to another table. I have been using DLast("field","table") in an append query to get this done. However, it blows up occasionally and points to the wrong record.
How does one easily and reliably select the right record to use for an append?
I use a query daily that appends records to a table. I used it this morning but now it will not append records. It is odd because when I switch from design view to results my records are there but when I run it the records do not populate. I am not getting a pop-up message like usual either. It appears as if my access 2003 has disabled that function, which I can;t even find to turn back on. Any suggestions?? Thanks.
I have written some codes to insert data into a table. I'm trying to get rid of the pop up message which say:
You are about to append one row(s). Once you click yes, you can't use the undo command to reverse the changes. Are you sure you want to append the selected rows?
I want to append records that I have created in Table1, via a form (Form1), to Table2, using Form1's OnClose event. (Table2 will be amended later, but I need to preserve Table1). Is there a way to append only the records from Table1 that haven't been previously appended to Table2? Also, can I turn off the warning messages in an append query? TIA
I have form linked to table 1. The form has a few control buttons that change certain fields. I am trying to make one of these controls also append a new record to table 2. Table 2 only contains three fields. One of them will have the ID number of the main record, the second field will have the date at the time the button was clicked, and the third will have the contents of a text field copied to it. I understand this is going to possibly create duplicates, but that's exactly what I want in this case.
My problem is; I don't have a dang clue what I'm doing!
I've tried the INSERT INTO stuff, and I tried to make an append query etc. but I just don't know what I'm doing because this is the first time i've ever had to do this.
I have created an append query. Inside that query I have one column that take a result from another query and I have about 10 columns that follow that one column by infomation from a table. I do have the query and table "join properties" at "Student-ID". I am appending to a blank table but its not putting any other information into the table. The only time it appends if there is information in there. Is there a way to append to table with no records?
2) a table with all kinds of material (approx. 10k rows)
3) a junction table with Invoice_ID and Material_ID
Now, I start the process in my Invoice Form. I have a button there to open a Material form, where I can lookup the Material_ID that I want to add to my invoice form.But I can't seem to find out how, once I select the record I need (with the Material_ID on the row), how I can append this to my junction table.The open Invoice form has the Invoice_ID and the active row in my Material form has the Material_ID, but how do I proceed?
I want to punch data in form and i want to append data to table and i want to automatically show new record when i reopen the form Now i face a problem that when i reopen form record show 1st table row.
Hi, I'm fairly new with working with Access and programming in VBA, and I was looking for some help. I have a database with many tables, and relationships between the tables. In particular, I export two of these tables to text files from one machine and need to import them back into the database on another machine. I have this working if I delete all the records before useing the transfertext command to import that table. But my problem is that I need to either append a record if it doesn't exist in the promary keys, or if the new record exists in a primary key, I need to replace it. I was thinking about reading the table to a temp table from the text file and checking each record in some sort of query to see if it needs to be appended or replaced in the table. Does anyone have any ideas of how else this could be accomplished a little easier that looping through each record, for this might take a while, as I do not know how many records can be importing each time. All I know is that I need a way of taking data from a text file and either appending or replacing the records in the table in the database. I appreciate any help I can get with this. Thank you.
I inherited an interesting problem. I have 3700 tiny MDB files all of which contain the same table (same name, field structure, etc.), but different data. Each database has a slightly different name. It's the result of XML data mining.
I need to combine these 3700 tables from these different databases into one table in one database.
I can't see any way to automate this and as it's a one-time only project I don't know whether it's worth trying to automate it or if I should roll up my sleeves and just start apending tables.