Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: VB Scripting at work  (Read 933 times)

0 Members and 1 Guest are viewing this topic.

hypernova

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2753
  • Last login:November 25, 2016, 12:52:48 pm
VB Scripting at work
« on: January 21, 2009, 04:47:54 pm »
At the start of the new year, we started using a new program called VISUAL.  It is made by Infor.  They have tapped me to become the "expert" of sorts on this new system.  I am no expert by any means when it comes to programming, but I can learn, as I've skimmed the surface a few times for html editing a few times, and I've checked out ahk just a hair, but haven't done anything with it.  Enough about me.  Now to my personal project.

Our orders need to have the correct shipping date on them in this new system, else it causes problems with invoicing.  Don't know why, but it just does.  Why is irrelevant right now.  As it stands right now, VISUAL can implement VBScripting.  To use a short term solution, we just make VISUAL blank out the date field, because it's normally populated by today's date.  This is the syntax:  <SHIPPED_DATE = " "> (without the <>.)  When you're preparing stuff for tomorrow, it's easy to forget to change that field, thus this easy fix.  Here's what I want to do.  I want to create a box that comes up and prompts you to select one of two, maybe three buttons.  These buttons say:  Today, Tomorrow, and maybe Other.  In the program, pressing T in the date field gets today's date to autopopulate.  + gets it to go up to the next day, i.e. tomorrow.  Here's what I've got so far.

dim date
date=InputBox("When is this order being shipped?","Date Selection","t")
SHIPPED_DATE = "document.write(date)"

Yes, this is an input box, rather than just a button to click on.  I know MsgBox has these buttons, but the names of the buttons can't be modified.  According to what I've read, InputBox has the capacity to utilize buttons, but I don't know how.  Also, this does NOT return any date to the correct field.  I was going for a today to autopopulate, but it didn't.  It actually blanked it.
I was thinking that the today button would return a T for that field, while a T followed by a + yielded a tomorrow for that field.  Is this possible from the sound of it?
I'll exercise patience when you stop exercising stupidity.
My zazzle page.  I've created T-shirts!

ark_ader

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5645
  • Last login:March 02, 2019, 07:35:34 pm
  • I glow in the dark.
Re: VB Scripting at work
« Reply #1 on: January 25, 2009, 08:02:53 am »
It has been many years since I coded VB, but if my memory is right, you would have to create a prompt that asks:

Today Yesterday No_Date

Then pass the correct value chosen to the requested field by passing a value via a condition.

The chosen integer would represent the value for the date to be placed in the field as requested.

I Google-d and found this, which should put you on the right track as it focuses on responses:

http://www.vbforums.com/showthread.php?t=218753

My above explanation shows how rusty I am at VB, but I do not use it anymore.  But I'm sure those guys could help you out.
If I had only one wish, it would be for three more wishes.