Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Hi,

Wondering if anyone has any idea how to do this; I have a simple database in which each record can have one of 2 or 3 possible entries from a validation list in several fields. For example one field entry could be "chocolate", "vanilla" or "strawberry", and another could be "cone" or "dish" and another could be "cash" or "credit".

I am trying to make a unique code for each possible combination that would auto-enter, based on the values in the other fields. So someone ordering chocolate in a cone and paying cash would be "1", and someone ordering vanilla in a cone with cash would be a "2" etc...

I am hoping this can be done by calculation, but at the moment, the only way I can think of doing it involves a script. Any thoughts welcome. Thanks,

Marcel

Hi Marcel,

I have attached an example of how you could do this. You should take into account that you want for instance more than one icecream flavours per order and that you can easily add new payment methods or packing material without having to redefine your calc. every single time. If not it´s ok, but with databasing it´s just like marriage...be prepared for the worst :

So In the example I already did that for you. Hopefully you can adjust it to your system. Good luck.

valuecode.zip

Edited by Guest

One very simple method would be:

Case (

Flavor = "chocolate"; 100 ;

Flavor = "vanilla" ; 200 ;

Flavor = "strawberry"; 300 )

+

Case (

Packaging = "cone"; 10 ;

Packaging = "dish" ; 20 )

+

Case (

Payment = "cash"; 1 ;

Payment = "credit" ; 2 )

The codes here not contiguous, so another packaging or payment method (up to 10) can be introduced in the future. There is also a flag if one of the fields is empty.

If you need contiguous codes, you could use something like:

4 * Case (

Flavor = "chocolate"; 0 ;

Flavor = "vanilla" ; 1 ;

Flavor = "strawberry"; 2 )

+

2 * Case (

Packaging = "cone"; 0 ;

Packaging = "dish" ; 1 )

+

Case (

Payment = "cash"; 0 ;

Payment = "credit" ; 1 )

Note that here adding a packaging or payment method would make all previously generated codes invalid.

4 * Case ( 

Flavor = "chocolate"; 0 ; 

Flavor = "vanilla" ; 1 ;

Flavor = "strawberry"; 2 )

+

2 * Case ( 

Packaging = "cone"; 0 ; 

Packaging = "dish" ; 1 )

+

Case ( 

Payment = "cash"; 0 ; 

Payment = "credit" ; 1 )

Indeed, but what if we arrange it to live in a cut up portal, where each portalrow points at it's own valuelist, the position in each valuelist gives where in the numberbase and number of items in each valuelist gives the numberbase in itself. It would be very easy to maintain by adding or removing items from the valuelists as far as getting the various combinations.

--sd

That is exactly what I meant with my examplefile:

example.JPG

ordercode explained:

3= 3 flavours

1= chocolate

7= banana

10= melon

1= cone

2= credit

valuecode.zip

Edited by Guest

  • Author

Wow, thank you for the flurry of responses. I have it working! Many thanks.

Marcel

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.