Inserting Data And Retrieving Fields

Aug 25, 2015

i have the below code which inserts data and then i want to retrieve the value in the first two columns but firstly it says "you must use dbseechanges" but i have put this into the code you may see below,

Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
dim sSQL as string

[code]....

View Replies


ADVERTISEMENT

Retrieving Data

Nov 13, 2007

Hi,

I am new to access and need help trying to retreive data. Basically I have a unique ID field (123545). I what a user via a form to be able to retreive data using this unqiue ID. Does anyone know the best way to achieve this in access please?

Thanks

Ket

View 1 Replies View Related

Retrieving Data From A Table

Feb 14, 2005

I have created an expense database but I now want to try to add fields to the main form which will allow the users to select their car engine capacity and the price they paid per litre to establish how much VAT can be reclaimed. A small extract from the table from customs & excise is set out as below (although the table headers have moved a bit). There are 5 engine capacity headers and numerous pence per litre rows.

Pence per litreUp to 1000cc1001 to 1500cc
75.08.5259.653
75.28.5509.682
75.58.5759.710
75.78.6009.738
75.98.6259.767
76.19.6509.795

So if someone had a car with the engine size between 1001 to 1500cc and had paid 75.7p per litre for their fuel we could reclaim VAT @ 9.738p per mile.

Is there anyway I can get access to look up this information for me?

View 5 Replies View Related

Retrieving Ebay Data

Dec 15, 2005

Does anyone know how to setup an ODBC to the Ebay Web Server?

View 3 Replies View Related

Retrieving Data From A Table

Feb 16, 2005

I put this on the tables forum but my answers have now stopped, can anyone here help me with how I get this information to appear on a form....

I have created an expense database but I now want to try to add fields to the main form which will allow the users to select their car engine capacity and the price they paid per litre to establish how much VAT can be reclaimed. A small extract from the table from customs & excise is set out as below. There are 5 engine capacity headers and numerous pence per litre rows.

Pence per litre ....Up to 1000cc.......1001 to 1500cc
75.0 ..................8.525.................9.653
75.2 ..................8.550.................9.682
75.5...................8.575.................9.710
75.7...................8.600.................9.738
75.9...................8.625.................9.767
76.1...................9.650.................9.795

So if someone had a car with the engine size between 1001 to 1500cc and had paid 75.7p per litre for their fuel we could reclaim VAT @ 9.738p per mile.

Is there anyway I can get access to look up this information for me?

.................................................. .................................................
Ans:

It would be nice if you could find out the formulae for working out the pence per mile bit based on the cc.

Either way, I think your table needs changing to this design

Price. . . . CC. . . . . . . . . . . . . VAT
75.0 . . . .1000. . . . . . . . . . . .8.525
75.0 . . . .1000 to 1500. . . . . . .9.653
etc
etc

Col
__________________
This ain't no technological breakdown. . .oh no, this is the road to hell.

.................................................. .................................................

Thanks,

Unfortunately I can't get hold of a formula. I'm still not sure how I would look up a value, even if I changed the table as you suggested. The user would need to select a cc size and then a price per litre which would then need to be cross referenced to give a value. I could set up different tables for each engine size, but then I'm not sure how I could point the answer at the correct table.
I don't even know if what I am trying to do is possible in access.

.................................................. .................................................. .

Sharon, you could have the price per litre in one ComboBox and the engine size in another. Both these would then be the criteria for a query.

Can you post your Db and I'll have a look for you, failing that I could knock one up (in Access97)

Col
__________________
This ain't no technological breakdown. . .oh no, this is the road to hell.

.................................................. ..................................................

I think I've attached the file, but I've never done this before so it might not be there!

The table I'm trying to create is called pence per litre but it is completely stand alone at the moment until I can work out how to get any information out of it. I have changed the table to your suggested layout but have only entered a few records, there are hundreds to be entered if it can be made to work!

Thanks

Sharon

.................................................. ................................................

I can't seem to get the file to attach it doesn't seem the right extention code it's an mdb

View 4 Replies View Related

Retrieving Database Data

Nov 18, 2005

In my employee attendance database each record contains an employee id#, a number corresponding to an attendance infraction, and a corresponding date. Each week a clerk queries the database to pull up records for all employees who have a yearly 'total number' of infraction values over a certain numerical limit.
Any suggestions as to what is the best way to:
1 - Calculate that yearly 'total number' for every employee.
2 - Retrieve the date of the most recent attendance infraction for each employee that has a total value that is over the limit?

Thanks

View 1 Replies View Related

Retrieving & Adding Data Problem

Jan 18, 2008

Hi All,

I need to make a payment based on the latest Verify Number to a specific person so i am trying to create a form that is focused around a person, looks up the latest Verify number and can make a new payment number to add new payments.

In my tables, it works perfectly excluding the latest Verify number whereas i do not have any filters set. The Verify numbers can change which is why i need to make a new payment based on the latest Verify number. Using this number, i can add many payments to a Payment Number and add many Payment Numbers to a Verify Number for example:

John
Verify NumberGo4566546
Payment Number 44
Payments101Work carried out £800
102Delivery costs £100
103Material Cost £400
Payment Number 49
Payment 168 Work Carried out £700
170Work Carried out£450
Verify Number Go4566952
Payment Number 50
Payments171Work Carried Out£900
177Work Carried Out£500
Steve
Verify Number Go5877654
Payment Number 51
Payments178Cleaning£120

My Tables are linked as follows:
Person Table( name of table )
PersonID( unique ID of that person )

Verify Table( name of table )
VerifyID( unique ID of the Verify Number )
PersonID( linking to Person Table )

PayNo Table( name of table )
PayNoID( unique Payment Number )
VerifyID( linking to Verify Table )

Payments( name of table )
PaymentID( unique Payment ID )
PayNoID( linking to PayNo table )

The Payments figures have no relevance as they are numbers given by the person to me so i do not need to link them, i only need to link the table they are entered onto.

I am trying to get this onto one form whereas i can see who i am paying, the latest verify number, the last payment number to the person and the last payments in a table. Then, i can click add a new payment number, and i can add a new set of payments t the newly created payment number.

Hope this makes sense!!


many thanks,

Nigel

View 1 Replies View Related

Retrieving Data From Unlinked Tables

Dec 13, 2007

I have a table (Working_Year) that is storing a single field which is the year (current_year) that is selected by the user in my initial form when the database is loaded. Am I able to use that data in other forms and reports with out linking the table? I would like to simply display the current_year the user is working in a textbox somewhere on the forms (example form named: "Main Entry") and use the current_year as a filter on reports (example report called "Gifts - by Type").

View 1 Replies View Related

Dashes Are Causing Problems Retrieving Data

Aug 2, 2006

I have a database with a series of fields, all set to a String datatype, that I want to be able to fill and then use with MS Word as a mail merge data source. This function lets you query a MS Access db and use the results to fill in predefined spots attached to the various data values in the table. This is great for my needs however a large percentage of times that I have a dash in the value being queried it does not return any results. For example, 01-01 would return no entry found even though I can clearly see it in the database, however it would work fine if I queried for 0101 or any other value in the given field.

Basically I'm trying to figure out why dashes would cause problems. They are obviously fine for being stored in the access database and don't cause any troubles until they are queried for, also retrieving data containing dashes is fine so long as that value is not the one being queried for.

I basically can't avoid the dashes in the data for this setup and as such hopefully can figure out why this happens and how to get around it. Thanks for any help offered.

View 1 Replies View Related

Retrieving Data From Excel Into An Access Form/table

Aug 3, 2005

Hopefully someone can help me this (and hopefully the solution isn't staring me in the face)

I am trying to export data from a cell in a worksheet to a field in an Access database that I am building. The database has two tables, tblCompanies and tblQuotes. It works through a macro accessed by a command button, which should export the total of a quote into the field Quote_Price in the tblQuotes table, which the users will access through a form. The problem is that if I export the data from Excel, I get an error message saying, "You cannot add or change a record because a related record is required in table 'tblCompanies'. The code looks like this:

Sub NewQuote()

Dim cn As ADODB.Connection, rs As ADODB.Recordset, r As Long
' connect to the Access database
Set cn = New ADODB.Connection
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=C:Documents and SettingsDJEdwardsMy DocumentsTest Foldermarketing.mdb;"
' open a recordset
Set rs = New ADODB.Recordset
rs.Open "tblQuotes", cn, adOpenKeyset, adLockOptimistic, adCmdTable
r = 55 ' the start row in the worksheet
Do While Len(Range("I" & r).Formula) > 0
With rs
.AddNew
.Fields("Quote_Price") = Range("I" & r).Value
.Update ' stores the new record
End With
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End Sub

I can import the cell contents from Access with no problems, but I would like the user to be able to do it from Excel to simplify things.

I'd be grateful for any help!

Cheers

Dave, England

View 2 Replies View Related

Forms :: Adding Table New Entries With Form Retrieving Data

Nov 15, 2014

I have quite an extensive form linked to a table. When I add new columns to the table I seem to have a problem getting the form to read the data.I have just added a numerical column to the table and added a text box on the form that is bound to it. When I try to pull up the value using VBA it is blank, even though an entry is visible on the form. I have set the text box to general number and the entry shows in the actual table. When typing in the entry into VBA it capitalises where required so it must be registering the table entry. However the value it pulls remains blank.

View 2 Replies View Related

Modules & VBA :: Inserting From Excel Number Of Query Values And Destination Fields Not Same

Jan 3, 2014

I am just beginning to manipulate Access from Excel.

I am trying to insert a row into a table. I am adding values for every field (8) except an Autonumber.

I have 2 Insert strings which are identical except for the fact that the one that doesn't work, doesn't specify which fields I am entering data into, which I presume shouldn't be necessary in this case.

When I try to use the second version I receive the error message...

Number of Query Values and Destination Fields are not the same.

The string that works perfectly is:-

Code:

strSQL = "INSERT INTO Clubs (ClubNumber,ClubName,ClubGrade,ClubRegion,ClubPosition,ClubHasHistory,clubinleague,cluboriginalposition) VALUES (" & clubCount + 1 & ",'" & lstrNewClubName & "'," & lintNewClubGrade & "," & lintRegion & "," & 0 & "," & vbFalse & ",'" & lstrNo & "'," & 10 & " )"

The one that generates the error message, which is identical except that I have removed the list of fields is:-

Code:

strSQL = "INSERT INTO Clubs VALUES (" & clubCount + 1 & ",'" & lstrNewClubName & "'," & lintNewClubGrade & "," & lintRegion & "," & 0 & "," & vbFalse & ",'" & lstrNo & "'," & 10 & " )"

The execute command is:-

Code:

gcnConnection.Execute strSQL, , adCmdText + adExecuteNoRecords

View 1 Replies View Related

Problems Inserting Data

Apr 12, 2006

I've searched all over and can't seem to figure out an answer to this, so I'm putting it in front of the experts (who'll probably have a simple answer in about 10 seconds).

I'm doing a survey that has both radio buttons and check boxes. If it were all radio, it'd be easy, but the check boxes are making it complicated for me.

Here's the insertion code I'm working with:
Code:SurveyInsert2 = "INSERT INTO data (answerID, surveyID) VALUES ('" & Request.Form(fld) & "', '" & currentsurvey & "')"oSurveyAdd.open SurveyInsert2, "dsn=survey" For Each fld in Request.FormoSurveyAdd.Execute(SurveyInsert2) Next
which is spewing the answer:
Code:Request object error 'ASP 0102 : 80004005'Expecting string input/survey_process.asp, line 44The function expects a string as input.

Help! What am I doing wrong?

View 11 Replies View Related

Inserting Data Into Two Tables - Urgent

Nov 7, 2006

Hi, this dilemma really has me in a bind - say I have table1 and table2, when I enter data/update table1, I need to also enter the same data into table2. I know this sounds royally weird, but if there is a way to do this I would appreciate any and all help asap!

Thanks in advance.

View 3 Replies View Related

Inserting/updating Data From A Csv File

Dec 8, 2005

Hi

I have recently had to add a new field to a FIRM table in our contact database, Firm.PhoneNumber (please don't ask why it wasn't there before!). The primary key in this table is Firm.FirmID.

I have a list available to me in .csv format that contains all the phone numbers I need, it has two 'columns', labelled FirmID and PhoneNumber.

The process is surely a simple one, I just need to update/copy/insert the corresponding phone numbers from the csv file into the Firm.PhoneNumber field. I won't bore you with what I've attempted thus far but could someone please provide me with the quickest possbile method for achieving this task?

Many thanks

Stuck21

View 1 Replies View Related

Inserting Data From Form Into Table

Nov 2, 2005

i have a problem adding the data from the fiels on the form into a table. I know you can just click on the navigation arrows and it will save the record but i want to use a submit button as this is more user-friendly and suitable for the work i'm doing.

I have attached the database... the form that needs the code for submit button is 'frmNew_JobStatus' and the table i'm trying to insert the data into is 'tblJobStatus'

can anybody have a look at what i've done so far and suggest how i can fix this... sample code would be very usefull as i'm not an access expert.

thank you all

View 1 Replies View Related

Inserting Data From One Table To Another Through Form

Aug 25, 2004

I want to design a form , please note I have beginners information regarding Access,
I have 2 tables , 1 table has Project No, Document No, DEpt NO. with all the information

There is another table-2 with Project No, Document No. and Resourcrce. There is not data
in this table

What I want to do is , I want to create a form where in I select the Project No. and
Dept No. When I select these items the form should list me the data in Table 1 for that
Project no and DEpt No. , after this data is listed , I will add the REsource data
and all this data has to be stored in table-2. I hope some one will be able to guide me on
how to do this.

View 6 Replies View Related

Inserting Data Into A Field From A Query.

Oct 3, 2004

Hi,
Am currently working on a project for AS IT. one problem that i need to come across is trying to see data in a field that comes from a query?!?! Confused?! so am i!

When i first open the form, a paremeter query appears asking me to insert a surname (which i have created) when i insert the surname....and click on the drop down button, it gives me three values...ForeName, Surname and class

When clicking on the pupils name, i want the Class of the student to be inserted into the Class Field!

Can anybody help?
Danbwest

View 1 Replies View Related

Warning Messege While Inserting Data

Feb 6, 2007

hi

when i am inserting data into table useing insert into statment i am getting one warning "do u want to append or not". what i can do to overcome this messeage.

View 2 Replies View Related

Forms :: Inserting Data In Table

Nov 9, 2013

I am new to Access and i am designing a payroll system for my company. I have created a Table with

EMP Id, Name, Basic Pay, Total Working Days, Actual Work Days, Earned Salary, OT days, OT Hrs, OT Pay..

Now i have created a form with all the above fields.and calculated the earned salary from the control source where Earned Salary= Basic pay / Total Working Days*Actual Work Days and OT Pay =[Basic Pay/Total Work Days/8]*150%*OT Hrs.

Now my problem is i am not able to populate the fields in the table.

View 4 Replies View Related

Inserting Data From Excell To Access Table

Mar 23, 2005

I am currently using access 97.

I am trying to read from an excel file that has the same format but changes data every day due to reports that I run from a different program. I just export them to this excel file called test.xls

What I want to do is import this data from the excel file and insert it into existing data in my table. I need to this every day.

Currently I cannot get the data to append. I can only insert the data once and cannot get it to append. I tried using macros, but think it would be better to use VB.

Any help you could provide would be great.

Thank You

View 1 Replies View Related

Inserting Data From Two Tables Into Another Table Using A Form

Oct 22, 2007

I am new to access (using Access 2003) and am having trouble working with forms. Here's what I want my form to do:

-Use a combo box to select a specific system
-Given the selected system, pull up ID numbers and descriptions (in separate text boxes) from two separate tables corresponding to that one system
-Navigate through those ID numbers/descriptions from each table independently to find ones that match
-Store the ID numbers of the ones that match into another linking table

The biggest problem right now is being able to navigate through the different table ID numbers/descriptions and add both ID numbers to a row in a different table. I've tried using a combo box with the INSERT INTO statement into the code builder, but I keep getting syntax errors.

Does anyone have any suggestions on a better way to do this?

Thanks!

View 3 Replies View Related

Queries :: Inserting Missing Data In A Table

Jan 10, 2015

How to fix some records in my access table. It is a huge table more than 12k records!

In one of the field there are some data missing. The logic to reconstruct them is easy but I am not sure how to apply it in Access.

I have three columns one is the student ID, Year, term1 and term2

ID Year Term1 Term2
1234 2001 001 002
1234 2002 002 002
1234 2003 002 003
1234 2004
1234 2005 004 004
3311 2001 003 003
3311 2002 003 004
3311 2003
3311 2004 005 005

In the above example student 1234 has a missing record in year 2004 which supposed to be Term2 in the previous year (i.e. 003) and Term2 supposed to be Term1 value in the following year (i.e. 004). Similarly for student 3311

ID Year Term1 Term2
1234 2001 001 002
1234 2002 002 002
1234 2003 002 003
1234 2004 003 004
1234 2005 004 004
3311 2001 003 003
3311 2002 003 004
3311 2003 004 005
3311 2004 005 005

View 3 Replies View Related

Modules & VBA :: Ms Access Lock Table While Inserting Data

Oct 31, 2014

In a Access 2003 database, I have an "Inscriptions" (subscription) database with a primary key on 2 fields idPersonnel (employee) and idSession. I have made a form so that user can select a session (in a listbox), then one or more employee (another listbox) and suscribe them to that session by using a button, which, on VBA side, first check that there is enough room on the session (defined by "MaxParticipants" field on "Sessions" table, linked to "Inscriptions" table on idSession), then insert data in "Inscriptions" table

This is working fine in a single-user environnement, but fails if 2 people want to join some employees on the same session at the same time, as I have a confirmation message between check and insertion. Therefore 2 users can select employees, get the confirmation message (at this point both are told there is enough room), resulting in having more people than expected joined to the session. Fortuneatly, if both users try to insert the same employee(s) to that table, one will get a duplicate error, but insertion will be made if employees are different.

On another DB engine, such as SQL server, I would use a stored procedure that would lock the table, do the check and the insertion then unlock the table.

But it does not seem to be possible in MS Access. What are the possibilities in MS Access to prevent a session from having more than maximum number of participants ?

View 1 Replies View Related

Forms :: Inserting Data From Multi Rows Into Separate Columns

Oct 17, 2013

I have a database with a form that has 3 fields in a subform. I need to paste there data from multi rows. Now I have to do this column by column and paying attention that I select them correctly. Is there a way to directly insert the data by selecting only 1 field and have the data directly there as it would in excel?

Now we use excel as a "between" road to paste it there and then copy it from excel and paste it into access.

View 9 Replies View Related

Modules & VBA :: Inserting Field Value When Adding Record Using Data Entry Form?

Dec 14, 2014

I have a form for entry and some fields are computed or result of a query from another table. I have a function that looks up a value from another table like so

************************************************** ********
Public Function GetTargetType() As Variant
GetTargetType = DLookup("type", "tblFormulations", "[tblFormulations!formulation]=Forms![frmNmsConsumptionEntry]![formulation]")
End Function
************************************************** ********

Which works fine when I test in the immediate window.Then I have this form event. This however does not insert this value when I am adding records using my continuous form.

************************************************** ********
Private Sub Form_BeforeInsert(Cancel As Integer)
Me!target_group = GetTargetType()
'Forms!frmNmsConsumptionEntry!target_group = GetTargetType()
'[tblNmsConsumption.target_group] = GetTargetType()
End Sub
************************************************** ********

making sure I can insert this value once retrieved.

View 7 Replies View Related







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