+ Reply to Thread
Results 1 to 5 of 5

Validating a uniuque name before saving Product in DB

  1. #1
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2007 and 2016
    Posts
    196

    Validating a uniuque name before saving Product in DB

    Hello all,

    I'm wanting to validate a unique name for a New Product in a Point of Sale application.

    I have been attempting to use either:

    Please Login or Register  to view this content.
    or
    Please Login or Register  to view this content.

    Either line of code has an issue and don't understand how to correct them. I'm not of the best course of action to accomplish this of if there is better way. The MACRO they are part of is below:

    Please Login or Register  to view this content.
    Thank you for looking,
    V/r,
    Jim
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Validating a uniuque name before saving Product in DB

    Hi Jim,

    You need and "IF" in front of those two bold lines. The "Then" needs a starting If to work correctly.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2007 and 2016
    Posts
    196

    Re: Validating a uniuque name before saving Product in DB

    MarvinP,

    I realized when I enter a name that is already in my list a Macro that is already running basically does the what trick. I have a Worksheet Change on that cell to Load the Product if it exists which fires if the name used is entered in that cell. So it does the same thing without me having to create another check.

    V/r,
    Jim

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Validating a uniuque name before saving Product in DB

    Hi sorensjp,

    I'm not sure if I helped to answer your question or not. You have rem'ed out two lines in your code that I un rem'ed ant stepped into that code. It didn't know how to handle a "Then" without an "If" in the front of both those lines. Did that help to answer your question?

  5. #5
    Forum Contributor sorensjp's Avatar
    Join Date
    12-23-2015
    Location
    Yokosuka, JP
    MS-Off Ver
    2007 and 2016
    Posts
    196

    Re: Validating a uniuque name before saving Product in DB

    MarvinP,

    I didn't ask the question correctly to start with. I forgot to un-rem the other lines of code to produce the same issues I had seen.

    I was thinking that either of the BOLD lines below in the code would check the helper cell (since I have it checking for a name already). But I realized by having that helper cell already fires a different load MACRO that effectively accomplished my results.

    Please Login or Register  to view this content.
    This project is a virtual "Ship's Store" for my ship so Crew Members can pre-order products. I'm adding many more features will be certainly asking plenty more questions.

    V/r,
    Jim

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Replacement product finder - Searching for matches based on various product attributes
    By gingert88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-22-2017, 01:17 PM
  2. Replies: 9
    Last Post: 10-16-2014, 07:46 AM
  3. Replies: 2
    Last Post: 09-10-2014, 08:56 AM
  4. [SOLVED] I'm receiving a Run-Time error 1004 while trying to delete a product from a product list.
    By redsab in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2014, 10:03 PM
  5. Replies: 1
    Last Post: 06-20-2014, 03:38 PM
  6. [SOLVED] Find Product Details in Another Sheet based on Product ID and Copy some Fields From there
    By kevalkothari in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-29-2012, 10:43 AM
  7. [SOLVED] Need Function that will find ordered product, and display the product code in a 2nd workbk
    By rollerden in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2012, 08:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1