User Profile

Collapse

Profile Sidebar

Collapse
Fezichimo
Fezichimo
Last Activity: Aug 26 '15, 04:25 PM
Joined: Aug 21 '15
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Fezichimo
    replied to Duplicate Entry Warning Message
    Have done as you suggested and the same problem still arises. In the Immediate Window it just comes up with whatever I had entered. For example:

    Hospital_Number = 'RTRTRTRTRT'

    It even still generates the MsgBox when I input punctuation which is never normally included in any patient's hospital_number . I wanted to make sure it wasn't because every individual digit/letter had appeared in a hospital number at some point.
    See more | Go to post

    Leave a comment:


  • Fezichimo
    replied to Duplicate Entry Warning Message
    Thank you Seth, that prevented the error message but the same problem still applies in that every time I enter ANYTHING in for hospital_number (text field) it generates the message box that is only supposed to warn you if a duplicate already exists. Any ideas? The code as it stands is as follows:

    Code:
    Private Sub Hospital_Number_BeforeUpdate(Cancel As Integer)
    
       If DCount("Hospital_Number", "Voc Rehab DB",
    ...
    See more | Go to post

    Leave a comment:


  • Fezichimo
    replied to Duplicate Entry Warning Message
    I removed the .Text as suggested as well as trying removing the Nz() function. However, removing the latter bracket led to an error code stating it expected a "Then or a Go To Statement". Removing the earlier end bracket was allowed but then returned the error: "Compile Error: Wrong number of arguments or Invalid Property Assignment".

    This is now the code:

    Code:
    Private Sub Hospital_Number_BeforeUpdate(Cancel
    ...
    See more | Go to post

    Leave a comment:


  • Fezichimo
    replied to Duplicate Entry Warning Message
    Once again, sorry, I need to be clearer!

    Every time a number is entered it delivers the MsgBox containing "The value you are adding already exists, do you want to continue?".

    This pops up even when you are entering a completely new hospital number and not a duplicate.
    See more | Go to post

    Leave a comment:


  • Fezichimo
    replied to Duplicate Entry Warning Message
    Sorry, yes, the code causes it to come up with an error message whatever is entered into the textbox. Even if there isn't an existing duplicate for that particular hospital number.
    See more | Go to post

    Leave a comment:


  • Fezichimo
    started a topic Duplicate Entry Warning Message

    Duplicate Entry Warning Message

    I'm trying to get a duplicate entry into a textbox flagged as a before_update warning message. The field is "Hospital_Numbe r" within the table "Voc Rehab DB". The Hospital Number is a text field since hospital numbers can include things like: U/G39401

    At the moment I have the following code:

    Code:
    Private Sub Hospital_Number_BeforeUpdate(Cancel As Integer)
    
        If Nz(DCount("Hospital_Number",
    ...
    See more | Go to post
    Last edited by Rabbit; Aug 21 '15, 05:52 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
No activity results to display
Show More
Working...