1 2 3 Previous Next 36 Replies Latest reply on Sep 4, 2012 1:33 PM by ewh1972

    if

    ewh1972

      Title

      if

      Post

      I have a table and there is a product name in the table I want it if the produtc number is a6b it = HP etc. and im my script i have nameed it product and click the if statement but it makes me put if again if i dont i get errors like + - excepted but if i put two if at beging it will not hp it show number you can see the image.

      if.PNG

        • 1. Re: if
          schamblee

          If statements (test;result1;result2) 

          If (ITInventory::Product="A6B";"HP";ITInventory::Product)

          • 2. Re: if
            philmodjunk

            From the "result must be boolean" text at the bottom, this appears to be an If script step you are setting up. But the expression you have entered looks like something you would define for a calculation field.

            Exactly what are you trying to do here?

            • 3. Re: if
              ewh1972

               When I scan in or imput a product number I want it to show the product name Product number aka product name HP etc

              • 4. Re: if
                philmodjunk

                Yes, but show the product name where? In a field or in a dialog box?

                If you want it to appear in a field, you do not actually need any calculation at all, this can be displayed from a table of product records.

                • 5. Re: if
                  ewh1972

                   yes when I input the product number in the product area I want the procduct name to show instead of the number.

                  • 6. Re: if
                    philmodjunk

                    First, let's get things to work so that you can see the product name AND the number. Then we can take a look at layout options that conceal the product number if you don't want to show it.

                    You haven't indicated what your database does exactly nor what tables you have created and I don't know the relationships you may have already defined.

                    So I will stick to a very narrow scope here--getting product names to appear in a field when you enter or scan a product number.

                    Note that in your original attempt you had to test for each possible product number to determine what product name should appear. Take that data out of your calculation and create a Products table with information like this:

                    Product Number        ProduductName
                    A7K06UT#ABA          HP
                    A6B85A8#ABA          HP

                    Each row here is a separate Record and you can add as many records as you need. You may already have this info in a table in your database.

                    Define this relationship:

                    YourTable::Product Number = Products::Product Number

                    Now you can place the Products::ProductName field on your layout for YourTable and when you enter or scan a product number in to YourTable::Product Number, the correct Product Name will appear in the Product Name field.

                    • 7. Re: if
                      ewh1972

                       I have a table called ITInventory see image and I want the product name in there when I scan or input the product number.
                      I have the product table product number in relationship with ITInventory product.

                      • 8. Re: if
                        philmodjunk

                        What I have described should do exactly that.

                        • 9. Re: if
                          ewh1972

                           My scanner is hooked using a usb cable and stay attached to it its a LS2208

                          • 10. Re: if
                            philmodjunk

                            As I have read in your other thread. See my comments there.

                            • 11. Re: if
                              ewh1972

                               ok I understand that but here is what I am having problem with now. When I am scanning into my Inventory table and scan the product number into the product area it changes the name in the products table to the product number

                              • 12. Re: if
                                philmodjunk

                                Which means that you are scanning your data into the wrong field.

                                You should scan your data into a different field.

                                First, do you have two fields, one for product number an done for product name?

                                Second, as stated in the other thread, do you want to perform a find for an inventory record or are you creating a new record in another table in your database that needs to refer to data in your inventory table? (Often, inventory tracking databases have a transaction table were you log each change in inventory in a new record and an Inventory table where you have one record for each item.)

                                It sounds like you need to put your product number field on the layout, enter find mode, put the cursor in the product number field, san the product number and then perform the find. But I am making a lot of guesses about what you actually want to do and what you have to do it with in terms of your database design.

                                • 13. Re: if
                                  ewh1972

                                   i figured that part out I scaned into product instead of product number for now I am just adding a recorde but will be woking on a find by scanning in the number next.

                                  • 14. Re: if
                                    ewh1972

                                     I figured out how to get the scanner to do a tab and all is working on insert product now. Now I have a button setup to find Inventory and I want it when hit it pulls up a show dialog to scan serical number, then on ok it preforms the find of the serial number and not insert that number into the table.

                                    1 2 3 Previous Next