473,657 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

increment revision value

Hi All,

I have 2 fields called document & Revision which contains the titles for
the documents to be stored in the databse it gets filled up as the user
enters them and the revison numbers associated with them.
1. What I need to do is to make sure that no duplicate entry is entered for
document and if entered should have a different revison number. I cannot
make them both as the primary key bacause there may be times when both the
fields maybe null but the entry must be there in the database.
2. If the user types in an existing document then I need the revision field
to be filled up with the current revision number after update.

I am a bit stuck here and any help will be great.

--
'Thanks & Regards'
Nov 13 '05 #1
4 1912
"Burghew" <bu*****@mailin ator.com> wrote:
If the user types in an existing document then I need the revision field
to be filled up with the current revision number after update.


There are a number of ways you could do this but perhaps using the DMax
method might be worth a look. You could have a DMax statement in the
'Default Value' property for your 'revision' text box such that it filters
your recordset for the contents of your 'document' field, finds the max
value from revision and then add 1:

DMax("[Revision]","[MyTable]","[Document] = 'MyCriteria'") +1

where MyTable is the name of your table and MyCriteria is the filter
criteria for the 'Document' Field.

I haven't tested this specific example but it should point you in the right
direction.

HTH - Keith.
www.keithwilby.com
Nov 13 '05 #2
As I recall, in Access, by creating a unique index on the combination of
fields (essentially a secondary key), you will enforce uniqueness, but allow
nulls. Another way to handle the optional nature of the document
title/revision combination is to split that into its own document identity
table, leaving the other fields in a document content table, and have a 1-to-1
relationship between them with the document content record as the source for
the primary key. The document identity table would use a uniqu index to
enforce uniqueness of the title/revision combination, but both fields would be
required since the record itself id optional.

To create a unique index on a combination of fields, you must go into the
indexes popup in table design, and put the 2 fields on consecutive rows with
the index name only on the first row. With the first row selected, check the
"Unique" box in the index properties.

On Tue, 14 Dec 2004 14:58:18 +0400, "Burghew" <bu*****@mailin ator.com> wrote:
Hi All,

I have 2 fields called document & Revision which contains the titles for
the documents to be stored in the databse it gets filled up as the user
enters them and the revison numbers associated with them.
1. What I need to do is to make sure that no duplicate entry is entered for
document and if entered should have a different revison number. I cannot
make them both as the primary key bacause there may be times when both the
fields maybe null but the entry must be there in the database.
2. If the user types in an existing document then I need the revision field
to be filled up with the current revision number after update.

I am a bit stuck here and any help will be great.


Nov 13 '05 #3
Steve Jorgensen wrote:
As I recall, in Access, by creating a unique index on the combination of
fields (essentially a secondary key), you will enforce uniqueness, but allow
nulls.


No. I agree with you that it should (set theory) but Access doesn't allow.

Can't set the IgnoreNulls in the PK either. I can set the property in
another index (not a primary one) but I can still not enter a Null in
the field.
--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #4
You could set the default value for revision to "" and allow zero length
strings.

"Bas Cost Budde" <b.*********@he uvelqop.nl> wrote in message
news:cp******** **@news2.solcon .nl...
Steve Jorgensen wrote:
As I recall, in Access, by creating a unique index on the combination of
fields (essentially a secondary key), you will enforce uniqueness, but allow nulls.


No. I agree with you that it should (set theory) but Access doesn't allow.

Can't set the IgnoreNulls in the PK either. I can set the property in
another index (not a primary one) but I can still not enter a Null in
the field.
--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1892
by: Burghew | last post by:
Hi All, I have 2 fields called document & Revision which contains the titles for the documents to be stored in the databse it gets filled up as the user enters them and the revison numbers associated with them. 1. What I need to do is to make sure that no duplicate entry is entered for document and if entered should have a different revison number. I cannot make them both as the primary key bacause there may be times when both the...
0
6092
by: Anders W. Pedersen | last post by:
Hi there! I'm working on a medium-sized .NET web application written in c#. We are using Visual Studio 2003 for development and Visual Source Safe as our code repository. Occasionally, we do a build and a deployment to our production server using a batch script which extracts the latest version of our code from VSS, compiles it and copies it onto the production server. All that is good and well, but I would like to add a small feature to...
3
4795
by: fragget | last post by:
where can i find a plugin that will automatically update the build number in vs.net? thx fg
4
1885
by: Klaus Jensen | last post by:
Hi! In VB6 I could set an option, so that when the app was built, the version number (minor) would autoincrement. It was also possible to access version information via code to display in a splash-screen or similar. I have searched for this option in Visual Studio, but have yet to find it. And how can I access this information via code, if possible? Thanks in advance!
5
5109
by: vul | last post by:
In VB6 there is Auto Increment check box in Project Properties, which allow you have a new version every time you compile the project. Is there any easy way to have this feature in VB 2005? Some of my blocks of code check and compare versions of EXE and DLLs located on the local workstation and the server. So it's very important for me to have an incremented number in case the project was rebuilt. It can be done manually, of course, but I...
2
5535
by: john | last post by:
Is it true that if I split my access database in backend and frontend and I implement custom auto increment for the ID fields, that my database is ready to be used in a multi-user environment? I found a zillion messages about auto increment and read some of them but it's confusing. Can someone point me to a simple custom auto increment example that I can download? Thank you, john
1
2191
by: ewingate | last post by:
I cannot seem to get the version number of my VB app to increment properly in VS2005. When I build the app each day the "build" number increments with no problem as does the version number but if I make multiple changes to my code during the day and then build again that same day the version number will not change. I have the attribute set to "1.0.*" and the default .NET formula of versioning is fine if only it would update whenever I make...
11
3895
by: divya_rathore_ | last post by:
The code: int aaa = 100; printf("%d %d %d\n", --aaa, aaa, aaa--); printf("%d\n", aaa); prints: 99 100 100 98
1
2171
by: news.microsoft.com | last post by:
Is there a way to have a timestamp automatically become part of the Assembly version number? I.e., so everytime the DLL compiles, the assembly version updates? TIA- MS
0
8411
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7351
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.