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. |
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
Unique entry
Symbol ID
Chris |
#14
|
|||
|
|||
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
|
|||
|
|||
Unique entry
Text.
Chris |
#16
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |