Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 10th, 2004, 09:46 AM
pinco's Avatar
pinco pinco is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Germany
Posts: 3 pinco User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Updating fields with last entry

Hi,
I'm starting with Microsoft Access and lots of things work and with lots of others I have to learn a lot.
So what I'm trying to do now is to speed up the entry of a new record in a table. I'm already managed to update certain fields according to the entry in other fields, but I now want to update ALL values of the new record from the last record entered.
I'm close to the solution, but it just doesn't work
I've entered the following code:

Private Sub Load_last_Click()

Dim sql As String
Dim ID_n As Integer
Dim m_instruction As String
Dim my_record As Recordset

m_instruction = "Select Max([Master database].ID) AS Analysis_file_name FROM [Master database]"
sql = m_instruction

' Open the recordset

Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset

rs.Open sql, CurrentProject.Connection

ID_n = rs![Analysis_file_name]

[Analysis_file_names].SetFocus
[Analysis_file_names].Text = ID_n

'Fills in the field Analysis_file_names with the value of the last ID

rs.Close

End Sub

Which works, but does not do what I would like... It put the value of the ID in a record named "Analysis_file_names". What I would like to do is to take from the last record the values of field1 and put then in the new field1, and so on for all the fields.

Suggestions? Comments? please...
I've tried other options I found in other posts, but these were not working. I should add that I'm using MS-Access 2002-SP2

Thanks,
helder-pinco

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Updating fields with last entry


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT