A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Unique entry



 
 
Thread Tools Display Modes
  #11  
Old October 26th, 2005, 01:47 AM
Chris
external usenet poster
 
Posts: n/a
Default Unique entry


Highlighted in yellow:
If DCount("*", "Borrowing", _
"[Symbol ID]=" & Me.[Symbol ID].Value) 0 Then

It says "text box Symbol ID". The control under 'data' we are working
on is Symbol ID. IME mode under 'other' shows no control.
Chris

  #12  
Old October 26th, 2005, 04:06 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default Unique entry

Open the form in design view. Richt click on the control that you're using
for the symbol data. Select Properties. Select Other tab. What is in the
Name box?
--

Ken Snell
MS ACCESS MVP



"Chris" wrote in message
oups.com...

Highlighted in yellow:
If DCount("*", "Borrowing", _
"[Symbol ID]=" & Me.[Symbol ID].Value) 0 Then

It says "text box Symbol ID". The control under 'data' we are working
on is Symbol ID. IME mode under 'other' shows no control.
Chris



  #13  
Old October 26th, 2005, 09:17 PM
Chris
external usenet poster
 
Posts: n/a
Default Unique entry

Symbol ID

Chris

  #14  
Old October 26th, 2005, 10:32 PM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default Unique entry

Is the field "Symbol ID" in table "Borrower" a numeric field or a text
field?

--

Ken Snell
MS ACCESS MVP

"Chris" wrote in message
ups.com...
Symbol ID

Chris



  #15  
Old October 26th, 2005, 11:46 PM
Chris
external usenet poster
 
Posts: n/a
Default Unique entry

Text.

Chris

  #16  
Old October 27th, 2005, 12:37 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default Unique entry

Then you'll need to delimit the control's value with ' characters:

If DCount("*", "Borrowing", _
"[Symbol ID]='" & Me.[Symbol ID].Value & "'") 0 Then

--

Ken Snell
MS ACCESS MVP


"Chris" wrote in message
oups.com...
Text.

Chris



  #17  
Old October 27th, 2005, 01:17 AM
Chris
external usenet poster
 
Posts: n/a
Default Unique entry

OK - that worked. The only problem I have now I am stuck in the box
because it won't accept null. If I am on my last symbol entry I am
stuck. Can you help me with this?

Chris

  #18  
Old October 27th, 2005, 03:27 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default Unique entry

I assume that an empty string will be satisfactory as a "replacement" for
Null in the test. Try this:

If DCount("*", "Borrowing", _
"[Symbol ID]='" & Nz(Me.[Symbol ID].Value, "") & "'") 0 Then

--

Ken Snell
MS ACCESS MVP


"Chris" wrote in message
ups.com...
OK - that worked. The only problem I have now I am stuck in the box
because it won't accept null. If I am on my last symbol entry I am
stuck. Can you help me with this?

Chris



  #19  
Old October 27th, 2005, 03:57 AM
Chris
external usenet poster
 
Posts: n/a
Default Unique entry

Private Sub Symbol_ID_BeforeUpdate(Cancel As Integer)
If DCount("*", "Borrowing", _
"[Symbol ID]='" & Nz(Me.[Symbol ID].Value, "") & "'") 0 Then
MsgBox "The value already exists!"
Cancel = True
End If
End Sub

I replaced the second two lines (see above) with what you gave me & the
response from the form was the same. Should I have taken any of the
other lines out?

Chris

  #20  
Old October 27th, 2005, 04:31 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default Unique entry

I think that we'll need to use the bang operator here instead of the dot
operator.

Private Sub Symbol_ID_BeforeUpdate(Cancel As Integer)
If DCount("*", "Borrowing", _
"[Symbol ID]='" & Nz(Me![Symbol ID].Value, "") & "'") 0 Then
MsgBox "The value already exists!"
Cancel = True
End If
End Sub


--

Ken Snell
MS ACCESS MVP

"Chris" wrote in message
oups.com...
Private Sub Symbol_ID_BeforeUpdate(Cancel As Integer)
If DCount("*", "Borrowing", _
"[Symbol ID]='" & Nz(Me.[Symbol ID].Value, "") & "'") 0 Then
MsgBox "The value already exists!"
Cancel = True
End If
End Sub

I replaced the second two lines (see above) with what you gave me & the
response from the form was the same. Should I have taken any of the
other lines out?

Chris



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Memo Field Sam General Discussion 12 November 10th, 2005 09:16 PM
How do I make a unique entry Lynn Bales New Users 9 August 15th, 2005 10:55 PM
How do I create a table of unique records from two or more tables Rubble Running & Setting Up Queries 5 June 23rd, 2005 12:05 PM
Query on unique Steven Running & Setting Up Queries 3 February 5th, 2005 12:24 AM
decipher log of scanpst.exe km General Discussion 0 July 18th, 2004 09:00 AM


All times are GMT +1. The time now is 07:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.