Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

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
  #1  
Old May 23rd, 2003, 09:19 PM
brockn brockn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 13 brockn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Access 2000 RecordSet - Search for Record and Edit it

I am using access 2000 and I want to be able to do this.

User comes up a form and enters a primary key then tabs off. Access finds that record and displays the information in the appropriate text boxes. The user can then edit the information and click complete.

Currently when the user enters the primary key Access thinks that the user is trying to add another record with the same primary key. I am thinking the problem might be that the form is bound to that table, but when I unbind it the code does not work. Code is listed below.

Thanks in advance for any help you can provide!

CODE STARTS HERE

Private Sub txtTagNumber_AfterUpdate()

Dim strSearch As String

On Error GoTo ErrorHandler

strSearch = "[TagNumber] = " & Me![txtTagNumber]
Me.Requery
Me.RecordsetClone.FindFirst strSearch
Me.Bookmark = Me.RecordsetClone.Bookmark

ErrorHandlerExit:
Exit Sub

ErrorHandler:
MsgBox "Error No: " & Err.Number & "; Description: " _
& Err.Description
Resume ErrorHandlerExit

End Sub

Reply With Quote
  #2  
Old May 24th, 2003, 11:30 AM
tron's Avatar
tron tron is offline
SwollenMember
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Austin, TX or the master control
Posts: 231 tron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 21 m 26 sec
Reputation Power: 8
Public Sub FindMeth()
Dim db As Database
Dim rec As DAO.Recordset
Dim intPK As Integer


Set db = CurrentDb()
Set rec = CurrentDb.OpenRecordset("SELECT * FROM tblNames", dbOpenDynaset)

intPK = 4

rec.FindFirst "PK = " & intPK

Do While rec.NoMatch = False

Debug.Print rec("Name") & " is a " & rec("Major") & " major"
rec.FindNext "PK = " & intPK

Loop

End Sub

Reply With Quote
  #3  
Old May 24th, 2003, 12:03 PM
brockn brockn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 13 brockn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Access 2000 RecordSet - Search for Record and Edit it


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





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