There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop malware monitor motherboard mouse network networking outlook 2007 power printer problem ram router screen slow sound spyware trojan usb virus vista vista 32-bit windows windows xp windowsxp winxp wireless
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
Visual Basic problem in Access DB


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
sthomp04's Avatar
Member with 89 posts.
 
Join Date: Sep 2003
08-Nov-2004, 10:25 AM #1
Visual Basic problem in Access DB
Please help. I am having a problem when trying to create a new record. Please see the attached Database and let me know where in the code I am having this problem and how to change it.
Attached Files
File Type: zip Tabular.zip (117.9 KB, 6 views)
CraigCKlein's Avatar
Junior Member with 20 posts.
 
Join Date: May 2004
Location: Blue Bell, PA
Experience: Advanced
08-Nov-2004, 12:22 PM #2
Hello,

You are going to have to be a little more clear. Please say something like:

In this database, form-xyz, control - btn_add, event- on_click

I am not sure where to find your problem to even begin to tell you where you may be going wrong.

Craig
sthomp04's Avatar
Member with 89 posts.
 
Join Date: Sep 2003
08-Nov-2004, 12:31 PM #3
Ok, I apologize. There is only 1 form and 1 main table (a few lookup tables) with 2 reports. The problem is in the fTabTransaction form when trying to add a new record by using the record navigation buttons. Sorry for not being more specific. Most of the code in the Calculations module deals with business rules to calculate a score but it keeps erroring on my use of a recordset.
CraigCKlein's Avatar
Junior Member with 20 posts.
 
Join Date: May 2004
Location: Blue Bell, PA
Experience: Advanced
08-Nov-2004, 02:13 PM #4
Well,

I see a lot of things that I don't really like:
1. You should use Option Explicit at the begining of every module. This forces you to declare ALL variables.
2. I don't see why you need the recordset object if you aren't actually doing anything with it. On a new record the recordset does not contain the New record until you save it.
3. If you do need to use Recordsets for the bound Recordset of a form use the RecordsetClone method of the Form Object (e.g. Set rs = me.recordsetclone "or Forms(strFrmName").recordsetclone). (see help for more details). This will also help you to keep the navigation straight with bookmarks.
4. I just think you are over complicating things here. Maybe I just don't understand what you are really trying to accomplish. But it seems to me you don't need to use a recordset in your CalculateDocDefects. I would recommend passing the form object to this procedure and then it will know exactly what you are doing.

use: Sub CalculateDocDefects(fTabTransaction As Form)

then in the procedure using fTabTransaction will always point to the record you are working with.


I hope this helps.
Craig
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:50 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.