473,378 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

a2k detect identical records

I have a couple of combo boxes on a continous form. The user is free to
select anything.

However if they select the same thing twice from combo1 and then combo2,
they've effectively created a duplicate record. What's a good way of
trapping this ? (as opposed to the increasing complex strategies I'm
forming).

e.g
Combo1-----Combo2
Apple Orange
Banana Lemon
Apple Lemon

is ok - each record is different

but;
Combo1-----Combo2
Mango Grapefruit
Apple Lemon
Apple Lemon

is not good as the last 2 entries are the same. I suppose something in the
beforeupdate event of Combo2 could do the checking and inform the user.
Is there a simple solution I could try before I go all around the houses
once more?

thanks
Martin
Nov 13 '05 #1
3 976
Martin,
one way to do it would be to limit the contents of the second combobox
so that the user cannot choose combinations that already exist. Just
use a NOT IN subselect as the rowsource for the second combo...
Nov 13 '05 #2
Pieter Linden wrote:
Martin,
one way to do it would be to limit the contents of the second combobox
so that the user cannot choose combinations that already exist. Just
use a NOT IN subselect as the rowsource for the second combo...


How would that work exactly? Would the second combo be referring to itself?

I suppose one thing I should make clear is that the rowsource for both
combos are entirely separate and different.
Nov 13 '05 #3
"Deano" <de*********@hotmail.com> wrote in message news:<41***********************@ptn-nntp-reader01.plus.net>...
I have a couple of combo boxes on a continous form. The user is free to
select anything.

However if they select the same thing twice from combo1 and then combo2,
they've effectively created a duplicate record. What's a good way of
trapping this ? (as opposed to the increasing complex strategies I'm
forming).

e.g
Combo1-----Combo2
Apple Orange
Banana Lemon
Apple Lemon

is ok - each record is different

but;
Combo1-----Combo2
Mango Grapefruit
Apple Lemon
Apple Lemon

is not good as the last 2 entries are the same.


One way would be to set the rowsource for the second combo to filter
out the chosen value from the first combo box... Something like...

SELECT FruitName
FROM tblFruits
WHERE FruitName<>[Forms]![MyForm]![cboFruit1]
ORDER BY FruitName;

then you couldn't choose a fruit twice, because the filtering would
eliminate the possibility.
Nov 13 '05 #4

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

Similar topics

1
by: Chumley the Walrus | last post by:
I want to insert records into two tables with identical fields at once, the below sql string is giving me an error at the comma " , " between tblProline and Prolinebup, the 2 tables i want to...
3
by: Andre Doreid Berro | last post by:
Greetings All I have requested help before and I really need your help in this. I am working on an Access database of contacts. I have plenty of records but plenty of them are almost...
1
by: Nicolae Fieraru | last post by:
Hi All, I have a table with the following information: ID, Name, Address, Field4 In this table it happens to have duplicate records with identical Name and Address but different content in...
2
by: sleepyant | last post by:
Hi, I have 2 identical tables in each server that I need to compare and update/insert accordingly using SQL. For example, server A as a source and Server B as destination which both have Table1....
48
by: phillip.s.powell | last post by:
MySQL 3.23.58 - 4.0.17 (yep, several database server instances, don't ask) I have database Spring with table Students I have database Summer with table Students I am tasked to produce a...
9
by: Rich | last post by:
Please help. Looking for a script to detect and display what version of Windows a user is running. Thanks in advance. Rich
5
by: KitKat | last post by:
I've got two queries; one is a modification of an older query; the other I created from scratch. The old one is about 5 copies down the road from something that has been expandable when I'm in...
1
by: Paul Wagstaff | last post by:
Hi Folks, I have a report for which I need three copies - identical in every way except each contains a label (lets call it 'lblReportInstance') with a caption saying "Part 1", "Part 2" and...
1
by: eolsson | last post by:
I have a .NET application and have added handwriting (via the PenInputPanel class) for users with Tablet PCs. The problem I'm having is that if I call this class it throws a runtime error if the...
1
by: Parasyke | last post by:
Thanks in advance to anyone on this... I have a central (Access 2003) database that I need to import about 10 tables from other databases (also Access 2003). Unfortunately they all have the table...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.