I have searched all the groups I can, and I still haven't been able to
come up the solution I need. I have the following problem.
In my form named sbfrmSpoolList, I am entering a job, spool and
revision number. My table is indexed properly to not allow
duplicates, but I would like teh user to be notified that they are
typing a duplicate via a message box, then I woulld the update of the
record to be cancelled. I have tried the DLookup, but I'm not sure
how to input it with multiple fields. I have set the the beforeupdate
event on the form, not the control. I would like to know the syntax
for checking for duplicates in the following fields txtBaseJob2,
txtSpoolNo, txtSpoolRev.
Any help would appreciated.
Thanks, JC 7 6777
Could you be clearer on what indexes you have, and what is or is not allowed
to be duplicted
Phil
<jo*******@shawgrp.comwrote in message
news:82**********************************@m73g2000 hsh.googlegroups.com...
>I have searched all the groups I can, and I still haven't been able to
come up the solution I need. I have the following problem.
In my form named sbfrmSpoolList, I am entering a job, spool and
revision number. My table is indexed properly to not allow
duplicates, but I would like teh user to be notified that they are
typing a duplicate via a message box, then I woulld the update of the
record to be cancelled. I have tried the DLookup, but I'm not sure
how to input it with multiple fields. I have set the the beforeupdate
event on the form, not the control. I would like to know the syntax
for checking for duplicates in the following fields txtBaseJob2,
txtSpoolNo, txtSpoolRev.
Any help would appreciated.
Thanks, JC
On Oct 10, 11:08*am, john.c...@shawgrp.com wrote:
I have searched all the groups I can, and I still haven't been able to
come up the solution I need. *I have the following problem.
In my form named sbfrmSpoolList, I am entering a job, spool and
revision number. *My table is indexed properly to not allow
duplicates, but I would like teh user to be notified that they are
typing a duplicate via a message box, then I woulld the update of the
record to be cancelled. *I have tried the DLookup, but I'm not sure
how to input it with multiple fields. *I have set the the beforeupdate
event on the form, not the control. *I would like to know the syntax
for checking for duplicates in the following fields txtBaseJob2,
txtSpoolNo, txtSpoolRev.
Any help would appreciated.
Thanks, JC
say the table is tblSpool
and the key is spoolId
in form_beforeUpdate
strwhere = "spoolNo = " & txtSpoolNo & " and spoolId <" & txtSpoolld
if (dcount("spoolId", "tblSpool", strwhere) 0) then
msgbox "Duplicate"
end if
On Oct 11, 12:19*am, "Phil Stanton" <p...@myfamilyname.co.ukwrote:
Could you be clearer on what indexes you have, and what is or is not allowed
to be duplicted
Phil
<john.c...@shawgrp.comwrote in message
news:82**********************************@m73g2000 hsh.googlegroups.com...
I have searched all the groups I can, and I still haven't been able to
come up the solution I need. *I have the following problem.
In my form named sbfrmSpoolList, I am entering a job, spool and
revision number. *My table is indexed properly to not allow
duplicates, but I would like teh user to be notified that they are
typing a duplicate via a message box, then I woulld the update of the
record to be cancelled. *I have tried the DLookup, but I'm not sure
how to input it with multiple fields. *I have set the the beforeupdate
event on the form, not the control. *I would like to know the syntax
for checking for duplicates in the following fields txtBaseJob2,
txtSpoolNo, txtSpoolRev.
Any help would appreciated.
Thanks, JC- Hide quoted text -
- Show quoted text -
My apologies for the lack of clarity. I am entering a job, spool and
the spool rev level. I don't want to the combination of all three be
repeated. I have the table (tblSpoolList) formatted properly with an
index for all three fields to not allow duplicates. Instead of
receiving the standard Access message for duplicate fields, I would
like to check if a duplicate Job, Spool and Rev exist and inform the
user. The table name is tblSpoolList. The field names and database
text field names are txtBaseJob2, txtSpoolNo and txtSpoolRev
I thought teh DLookup function could do this, but as I understand it,
it only looks for duplicates in one field. Each of the three fields
have duplicates for sure, but as a group, they CANNOT duplicate.
JC
On Oct 11, 3:29*am, john.c...@shawgrp.com wrote:
On Oct 11, 12:19*am, "Phil Stanton" <p...@myfamilyname.co.ukwrote:
Could you be clearer on what indexes you have, and what is or is not allowed
to be duplicted
Phil
<john.c...@shawgrp.comwrote in message
news:82**********************************@m73g2000 hsh.googlegroups.com....
>I have searched all the groups I can, and I still haven't been able to
come up the solution I need. *I have the following problem.
In my form named sbfrmSpoolList, I am entering a job, spool and
revision number. *My table is indexed properly to not allow
duplicates, but I would like teh user to be notified that they are
typing a duplicate via a message box, then I woulld the update of the
record to be cancelled. *I have tried the DLookup, but I'm not sure
how to input it with multiple fields. *I have set the the beforeupdate
event on the form, not the control. *I would like to know the syntax
for checking for duplicates in the following fields txtBaseJob2,
txtSpoolNo, txtSpoolRev.
Any help would appreciated.
Thanks, JC- Hide quoted text -
- Show quoted text -
My apologies for the lack of clarity. *I am entering a job, spool and
the spool rev level. *I don't want to the combination of all three be
repeated. *I have the table (tblSpoolList) formatted properly with an
index for all three fields to not allow duplicates. *Instead of
receiving the standard Access message for duplicate fields, I would
like to check if a duplicate Job, Spool and Rev exist and inform the
user. *The table name is tblSpoolList. *The field names and database
text field names are txtBaseJob2, txtSpoolNo and txtSpoolRev
I thought teh DLookup function could do this, but as I understand it,
it only looks for duplicates in one field. *Each of the three fields
have duplicates for sure, but as a group, they CANNOT duplicate.
JC- Hide quoted text -
- Show quoted text -
say the table is tblSpool
and the key is spoolId
in form_beforeUpdate
strwhere = "spoolNo = " & txtSpoolNo & " and " & _
"baseJob2 = " & txtBaseJob2 & " and " & _
"spoolRev = " & txtSpoolRev & " and " & _
"spoolId <" & txtSpoolld
if (dcount("spoolId", "tblSpool", strwhere) 0) then
msgbox "Duplicate"
end if
note this assumes all fields are numeric, if any field is text you
need an extra '
ie. "spoolNo = '" & txtSpoolNo & "' and " & _
On Oct 11, 4:40*pm, Roger <lesperan...@natpro.comwrote:
On Oct 11, 3:29*am, john.c...@shawgrp.com wrote:
On Oct 11, 12:19*am, "Phil Stanton" <p...@myfamilyname.co.ukwrote:
Could you be clearer on what indexes you have, and what is or is not allowed
to be duplicted
Phil
<john.c...@shawgrp.comwrote in message
>news:82**********************************@m73g200 0hsh.googlegroups.com....
I have searched all the groups I can, and I still haven't been able to
come up the solution I need. *I have the following problem.
In my form named sbfrmSpoolList, I am entering a job, spool and
revision number. *My table is indexed properly to not allow
duplicates, but I would like teh user to be notified that they are
typing a duplicate via a message box, then I woulld the update of the
record to be cancelled. *I have tried the DLookup, but I'm not sure
how to input it with multiple fields. *I have set the the beforeupdate
event on the form, not the control. *I would like to know the syntax
for checking for duplicates in the following fields txtBaseJob2,
txtSpoolNo, txtSpoolRev.
Any help would appreciated.
Thanks, JC- Hide quoted text -
- Show quoted text -
My apologies for the lack of clarity. *I am entering a job, spool and
the spool rev level. *I don't want to the combination of all three be
repeated. *I have the table (tblSpoolList) formatted properly with an
index for all three fields to not allow duplicates. *Instead of
receiving the standard Access message for duplicate fields, I would
like to check if a duplicate Job, Spool and Rev exist and inform the
user. *The table name is tblSpoolList. *The field names and database
text field names are txtBaseJob2, txtSpoolNo and txtSpoolRev
I thought teh DLookup function could do this, but as I understand it,
it only looks for duplicates in one field. *Each of the three fields
have duplicates for sure, but as a group, they CANNOT duplicate.
JC- Hide quoted text -
- Show quoted text -
say the table is tblSpool
and the key is spoolId
in form_beforeUpdate
strwhere = "spoolNo = " & txtSpoolNo & " and " & _
* * * * * * * * "baseJob2 = " & txtBaseJob2 & " and " &_
* * * * * * * * "spoolRev = " & txtSpoolRev & " and " &_
* * * * * * * * * "spoolId <" & txtSpoolld
if (dcount("spoolId", "tblSpool", strwhere) 0) then
* * msgbox "Duplicate"
end if
note this assumes all fields are numeric, if any field is text you
need an extra '
ie. "spoolNo = '" & txtSpoolNo & "' and " & _- Hide quoted text -
- Show quoted text -
Ok, you've lost me. They primary key for the table consists of the
ID, txtSpoolNo and txtSpoolRev fields. There is no field named
spoolid. Can you clarify what you mean that for? Here is teh code I
currently have, but its working.
Dim strWhere As String
strWhere = "spoolNo = '" & txtSpoolNo & " and " & _
"baseJob2 = '" & txtBaseJob2 & " and " & _
"spoolRev = '" & txtSpoolRev & " and " & _
"spoolId <" & txtSpoolld
If (DCount("spoolId", "tblSpoolList", strWhere) 0) Then
MsgBox "Duplicate"
End If
I'm sorry for the trouble. I'm really good in vba for Excel, but I'm
almost lost in Access. Thanks for the help.
JC
On Oct 11, 8:03*pm, john.c...@shawgrp.com wrote:
On Oct 11, 4:40*pm, Roger <lesperan...@natpro.comwrote:
On Oct 11, 3:29*am, john.c...@shawgrp.com wrote:
On Oct 11, 12:19*am, "Phil Stanton" <p...@myfamilyname.co.ukwrote:
Could you be clearer on what indexes you have, and what is or is not allowed
to be duplicted
Phil
<john.c...@shawgrp.comwrote in message
news:82**********************************@m73g2000 hsh.googlegroups.com...
>I have searched all the groups I can, and I still haven't been able to
come up the solution I need. *I have the following problem.
In my form named sbfrmSpoolList, I am entering a job, spool and
revision number. *My table is indexed properly to not allow
duplicates, but I would like teh user to be notified that they are
typing a duplicate via a message box, then I woulld the update ofthe
record to be cancelled. *I have tried the DLookup, but I'm not sure
how to input it with multiple fields. *I have set the the beforeupdate
event on the form, not the control. *I would like to know the syntax
for checking for duplicates in the following fields txtBaseJob2,
txtSpoolNo, txtSpoolRev.
Any help would appreciated.
Thanks, JC- Hide quoted text -
- Show quoted text -
My apologies for the lack of clarity. *I am entering a job, spool and
the spool rev level. *I don't want to the combination of all three be
repeated. *I have the table (tblSpoolList) formatted properly with an
index for all three fields to not allow duplicates. *Instead of
receiving the standard Access message for duplicate fields, I would
like to check if a duplicate Job, Spool and Rev exist and inform the
user. *The table name is tblSpoolList. *The field names and database
text field names are txtBaseJob2, txtSpoolNo and txtSpoolRev
I thought teh DLookup function could do this, but as I understand it,
it only looks for duplicates in one field. *Each of the three fields
have duplicates for sure, but as a group, they CANNOT duplicate.
JC- Hide quoted text -
- Show quoted text -
say the table is tblSpool
and the key is spoolId
in form_beforeUpdate
strwhere = "spoolNo = " & txtSpoolNo & " and " & _
* * * * * * * * "baseJob2 = " & txtBaseJob2 & " and "& _
* * * * * * * * "spoolRev = " & txtSpoolRev & " and "& _
* * * * * * * * * "spoolId <" & txtSpoolld
if (dcount("spoolId", "tblSpool", strwhere) 0) then
* * msgbox "Duplicate"
end if
note this assumes all fields are numeric, if any field is text you
need an extra '
ie. "spoolNo = '" & txtSpoolNo & "' and " & _- Hide quoted text -
- Show quoted text -
Ok, you've lost me. *They primary key for the table consists of the
ID, txtSpoolNo and txtSpoolRev fields. *There is no field named
spoolid. *Can you clarify what you mean that for? *Here is teh code I
currently have, but its working.
Dim strWhere As String
strWhere = "spoolNo = '" & txtSpoolNo & " and " & _
* * * * * * * * "baseJob2 = '" & txtBaseJob2 & " and " & _
* * * * * * * * "spoolRev = '" & txtSpoolRev & " and " & _
* * * * * * * * "spoolId <" & txtSpoolld
If (DCount("spoolId", "tblSpoolList", strWhere) 0) Then
* * MsgBox "Duplicate"
End If
I'm sorry for the trouble. *I'm really good in vba for Excel, but I'm
almost lost in Access. *Thanks for the help.
JC- Hide quoted text -
- Show quoted text -
UPDATE!!!!!!
I've got teh syntax of the code correct, and it's working properly. I
have only one question left. After the message box, I would like to
stop the action to save the record. What's teh syntax for that.
Here's the code I have right now.
Dim strWhere As String
strWhere = "[txtSpoolNo] = '" & txtSpoolNo & "' and " & _
"[txtbaseJob2] = '" & BaseJob2 & "' and " & _
"[txtSpoolRev] = '" & SpoolRev & "'"
If (DCount("txtSpoolNo", "tblSpoolList", strWhere) 0) Then
MsgBox "The Spool and Rev was previously released for this
project. Check your data and try again."
End If
JC
On Oct 11, 8:03*pm, john.c...@shawgrp.com wrote:
On Oct 11, 4:40*pm, Roger <lesperan...@natpro.comwrote:
On Oct 11, 3:29*am, john.c...@shawgrp.com wrote:
On Oct 11, 12:19*am, "Phil Stanton" <p...@myfamilyname.co.ukwrote:
Could you be clearer on what indexes you have, and what is or is not allowed
to be duplicted
Phil
<john.c...@shawgrp.comwrote in message
news:82**********************************@m73g2000 hsh.googlegroups.com...
>I have searched all the groups I can, and I still haven't been able to
come up the solution I need. *I have the following problem.
In my form named sbfrmSpoolList, I am entering a job, spool and
revision number. *My table is indexed properly to not allow
duplicates, but I would like teh user to be notified that they are
typing a duplicate via a message box, then I woulld the update ofthe
record to be cancelled. *I have tried the DLookup, but I'm not sure
how to input it with multiple fields. *I have set the the beforeupdate
event on the form, not the control. *I would like to know the syntax
for checking for duplicates in the following fields txtBaseJob2,
txtSpoolNo, txtSpoolRev.
Any help would appreciated.
Thanks, JC- Hide quoted text -
- Show quoted text -
My apologies for the lack of clarity. *I am entering a job, spool and
the spool rev level. *I don't want to the combination of all three be
repeated. *I have the table (tblSpoolList) formatted properly with an
index for all three fields to not allow duplicates. *Instead of
receiving the standard Access message for duplicate fields, I would
like to check if a duplicate Job, Spool and Rev exist and inform the
user. *The table name is tblSpoolList. *The field names and database
text field names are txtBaseJob2, txtSpoolNo and txtSpoolRev
I thought teh DLookup function could do this, but as I understand it,
it only looks for duplicates in one field. *Each of the three fields
have duplicates for sure, but as a group, they CANNOT duplicate.
JC- Hide quoted text -
- Show quoted text -
say the table is tblSpool
and the key is spoolId
in form_beforeUpdate
strwhere = "spoolNo = " & txtSpoolNo & " and " & _
* * * * * * * * "baseJob2 = " & txtBaseJob2 & " and "& _
* * * * * * * * "spoolRev = " & txtSpoolRev & " and "& _
* * * * * * * * * "spoolId <" & txtSpoolld
if (dcount("spoolId", "tblSpool", strwhere) 0) then
* * msgbox "Duplicate"
end if
note this assumes all fields are numeric, if any field is text you
need an extra '
ie. "spoolNo = '" & txtSpoolNo & "' and " & _- Hide quoted text -
- Show quoted text -
Ok, you've lost me. *They primary key for the table consists of the
ID, txtSpoolNo and txtSpoolRev fields. *There is no field named
spoolid. *Can you clarify what you mean that for? *Here is teh code I
currently have, but its working.
Dim strWhere As String
strWhere = "spoolNo = '" & txtSpoolNo & " and " & _
* * * * * * * * "baseJob2 = '" & txtBaseJob2 & " and " & _
* * * * * * * * "spoolRev = '" & txtSpoolRev & " and " & _
* * * * * * * * "spoolId <" & txtSpoolld
If (DCount("spoolId", "tblSpoolList", strWhere) 0) Then
* * MsgBox "Duplicate"
End If
I'm sorry for the trouble. *I'm really good in vba for Excel, but I'm
almost lost in Access. *Thanks for the help.
JC- Hide quoted text -
- Show quoted text -
Me.Undo
Got it.
Roger, thank you for your help.
Everything is working as it should.
Thanks again. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ben Willcox |
last post by:
Hi I am having difficulty writing an SQL query to do what I want:
I have 1 table with 2 columns, 'id' and 'name':
tbl_names:
id name
-- ----
1 Bob
2 Jeff
3 Fred
|
by: mark.reichman |
last post by:
First off.. Thanks to Grant Wagner for help in a previous thread
related to this one.
I am at a total loss... I have multiple fields in a form with the
same name. Lets call the fields with the...
|
by: CFW |
last post by:
I use the following flawlessly to insert a single field:
strSQL = "Insert into (Casket) Values " _
& "(" & conQuote & NewCasket & conQuote & ")"
Set db = CurrentDb
If MsgBox(NewCasket & " is...
|
by: tesc |
last post by:
I am so aggravated and need any help I can get. I am using Access 2000
and am trying to sort multiple fields in a select query.
My query is set up as follows:
FIELD 1 FIELD 2 FIELD 3 ...
|
by: JP SIngh |
last post by:
Hi All
This is a complicated one, not for the faint hearted :) :) :)
Please help if you can how to achieve this search.
We have a freetext search entry box to allow users to search the...
|
by: mkjets |
last post by:
I have worked for hours on trying to find a solution and have not
figured it out. I am working in Access 2003. I need to create a query
that takes values from 1 table and displays them in...
|
by: 4Him |
last post by:
First off, let me say this is a great site! I've just started working with Access and much of my success is from what I've read here!
Background: I have a form, driven off a single table.
Goal:...
|
by: Nathan Sokalski |
last post by:
I have a Repeater that uses a DataSource that has multiple fields. When the
values of these fields is displayed in the Repeater, there are fields that
are used in combination with other fields as...
|
by: bonneylake |
last post by:
Hey Everyone,
Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place.
...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
| |