vba courses london - finding and updating records
Microsoft Office Training verified by visa - mastercard securecode about microsoft training company london ukadd this page to your favourites/bookmarksAdd to favourites
view a printable version of this pagePrintable version
email this page to somebodyEmail this page
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft VBA Training and help » vba courses london - Finding and updating records in a form

vba courses london - Finding and updating records in a form

The UK's most regular instructor-led training courses.
Training information: vba courses london · Excel london

resolvedResolved · Low Priority · Version Standard

Finding and updating records in a form

Louise has attended:
Access VBA course

by - delegate Louise [4 posts] (2007 Apr 27 Fri, 16:07) replyReply

I want to be able to search a field in a form and if a question has not been answered correctly (currently reads "tbc") then go to that record so that the user can amend it.

I have tried using recordsets and it will successfully locate the record but when I change the record to say "No" and then press my button and the error appears again so the user needs to change it again I get error 3020.

I can see why I'm getting this error because I am not writing my inital change to the table but I'm not sure where to put the .update.

This is the code:

Me.RecordsetClone.MoveFirst
Me.Bookmark = Me.RecordsetClone.Bookmark
Me.RecordsetClone.FindFirst "ActionTakenNY = 'tbc'"
If Me.RecordsetClone.NoMatch = True Then
MsgBox "Everything ok"
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
Me.RecordsetClone.Close
End Sub

RE: Finding and updating records in a form

by - trainer David gold contributer[428 posts] (2007 Jun 1 Fri, 09:57) replyReply

Hi Louise

Sorry for the delay in getting back to you, but we have been very busy.

If I was trying to solve this problem waht I would do is

- use what you have done so far, so that you go to the record that with tbc.

-I would include a button on the form that says update, so when you have change tbc to no, you would click the update button, this is where you would write the change to the database using the .update. You could take this a step further and have a message box that says "are you sure that you want to update this record.

Hope this helps and again sorry for the delay.

David

RE: Finding and updating records in a form

by - delegate Louise [4 posts] (2007 Jun 1 Fri, 09:59) replyReply

Hi David,

Thank you for your reply I will give it a go!!

Louise


Related articles

· Company Roles in Visual Basic Training
· What Is Microsoft Excel VBA and How Can It Help You Work Smarter?

Vba tip:

Good coding practice

It is important that you always comment the VBA code that you write. By doing this it will make the code much easier to read, as both yourself and other people will be able to see what the code is doing or meant to be doing. This is very important if there is more than one person who writes code in the company as you may have different styles of coding and may not really understand what the other person is trying to do. Also if you write some code and then do not touch it for a year or so you may actually forget what it is meant to be doing. so it is very important to include comments throughout your code and try and make sure that they are as useful as possible

View all VBA hints and tips

Institute of IT Training - Accredited Training Provider Microsoft Certified Partner
microsoft office
Microsoft Office Specialist Authorised Testing Centre (MOS and MCAS)

Prodigy Platinum Learning Partner

Institute of IT Training - Accredited Training Provider Association of Computer Trainers Valid HTML 4.01 Transitional
Valid CSS Markup

secure online payments - visa - mastercard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Training by application Main information pages See also

Access courses
DreamWeaver courses
Excel courses
MS Project courses
Outlook courses
PowerPoint courses
VBA courses
Word courses
(more...)

Public scheduled courses
On-site training
Closed company courses

Microsoft Office training
Pricing and availability
Training schedule
Training venues

Access training
Dreamweaver training
Excel training
MS Project training
PowerPoint training

London Computer Training
Computer Training London

Microsoft Access training
Microsoft Excel training
Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training

Time Management Course London

Interested in Access training? Please see the following pages:
microsoft access courses · microsoft training access course
microsoft+access+training · access courses in london

Training Information
AddThis Social Bookmark Button What's this?
Add to Del.icio.us Add to Facebook Add to Digg Add to Reddit Add to Google Add to Yahoo Add to Diigo Add to Mr. Wong Add to Linkarena Add to Power Oldie Add to Folkd Add to Jumptags Add to Upchuckr Add to Simpy Add to StumbleUpon Add to Slashdot Add to Netscape Add to Furl Add to Spurl Add to Blinklist Add to Blogmarks Add to Technorati Add to Newsvine Add to Blinkbits Add to Ma.Gnolia Add to Smarking Add to Netvouz