Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 1st, 2006, 08:58 PM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Conditional default value

UGH! I'm a self taught VBA programmer so, forgive me if this isn't clear.

I've been trying for a couple days to figure out. . . I have a form with 3 fields cboControl, cboClass and txtCount which writes to an Entries table. Here's what my table looks like -

MyTable:
Control #(PK), Class, Count
123, 1.1, 1
123, 1.1, 2
123, 1.2, 1
123, 1.2, 2
987, 1.1, 1
987, 1.1, 2
987, 1.2, 1
987, 1.2, 2

In the table I have a rule on the Count field that the value can only be 1 or 2 and I have the default value set to 1. So, as the user submits entries they must evaluate previous entries to determine if the count should be 1 or changed to 2. What they are asking for is for the form to do this evaluation and default the count based on entries that exist for the Control # and Class. Hope this makes sense.

I've tried different Event Procedures and just can't seem to make it recognize the previously entered data at the right time.

Thanks for any help!!

 
Old January 3rd, 2006, 06:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is the Count the number of records with same values for Control# and Class? if that so, it is redondant because you can use the SELECT COUNT query (and much safier) Never store in a database something that can be computed.
Marco





Similar Threads
Thread Thread Starter Forum Replies Last Post
regarding conditional statements abhi.prince4u XSLT 1 July 21st, 2007 06:00 AM
conditional IF roy_mm Reporting Services 0 October 30th, 2006 07:52 AM
C# Conditional statements sporkman43 General .NET 2 July 23rd, 2004 09:10 AM
Conditional Login acdsky Classic ASP Basics 2 November 25th, 2003 11:59 AM
conditional output AndersR XSLT 1 August 15th, 2003 12:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.