|
-
Feb 7th, 2010, 04:11 PM
#1
Thread Starter
Junior Member
Check for duplicate records
Hello,
I’m not exactly sure how to explain my problem but here I go…
First off, I must state – I’m no programmer. I can work with simple Microsoft Access databases, but nothing too complicated.
We have numerous complex VBA routines written for our CAD software (MicroStation) that assist in linking graphic elements to an Access database. The current procedure includes VBA forms developed in MicroStation which uses Microsoft Visual Basic v6.5. For the most part all works fine.
My problem –
In the database we track manhole districts, numbers, and labels. The database is called SEWERS.mdb; the table is SAN_MH; and the fields in question are DISTRICT, MH_NO, and LABEL. The field LABEL is actually a combination of DISTRICT and MH_NO separated by a hyphen (e.g., District 12, Manhole 47 Label would be 12-47). I realize we are being redundant with the LABEL field but this is an old DB originally imported from dBASE. There are other old routines coded to use the LABEL field so I just left it in.
The LABEL field was originally not indexed. I have set Indexed = Yes (No duplicates). This works fine and does not allow dups. In our CAD procedure, if a user enters a duplicate Label (i.e., District + MH_NO), an error pops up stating Duplicate Value. However, after closing the error message box, it proceeds to place the text although not populating the record. We have to re-enter the correct data to populate the table correctly.
What I’m looking for is the code/procedure that after keying in the DISTRICT and MH_NO field in the form, it checks to see if a LABEL with that combination of DISTRICT-MH_NO exists. If so, exit routine, otherwise proceed. I am aware of Access’s “After Update” event but I do not see anything similar in MicroStation’s form events.
I have included a couple screen shots of my error and MicroStation's Form properites window.
Any suggestions would be appreciated.
Thanks for your time,
SKK
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|