Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Macola ES VBA Starting Out

Macola ES VBA Starting Out

Macola ES VBA Starting Out

I am new to Macola ES version 9.5.100 and programming so be very appreciative if someone could help by providing me a sample code to do the following:

In order entry, when someone enters "Qty Ordered", I would like it to show a message box that display "qty_on_hand" from the "iminvloc_sql" table

Thank you,

RE: Macola ES VBA Starting Out

Why not just click the "loc/qty" button? No need to program functionality that already exists.

Software Training, Implementation, Programming and Support for Macola Progression, Macola ES, Synergy, and Crystal Reports. Check out our Macola tools: www.gainfocus.biz/exceladdin.html

RE: Macola ES VBA Starting Out

Well, the main purpose of the thread was to get an idea on how to get started so I was hoping for a sample code. What I am really looking to do is to utilize user_def_fld_1 in iminvloc_sql and set a maximum qty per order to develop a "no back order promise". Every time that a customer orders greater than maximum qty per order a warning message will generate and inform the staff to call a supervisor. From there, I will eventually want to check maximum qty per week, preventing customer ordering on multiple order defeating the purpose of maximum. Anyhow, long story short, I did some reading on VB scripting and from the thread http://www.tek-tips.com/viewthread.cfm?qid=1561142 I was able to come up with the code (works but require more tuning). In case any one is interested, here is the code:

'Max Qty Per Order VB Script (Active X need to be referenced)
Private Sub QtyOrderedCredited_LoseFocus(AllowLoseFocus As Boolean)

Dim rs1 As New ADODB.Recordset
Set rs1.ActiveConnection = macForm.ConnInfo.OpenADOConn

sqlstring1 = "select user_def_fld_1 from iminvloc_sql where loc ='CBC' and item_no='" & macForm.Item.Text & "'"
rs1.Open sqlstring1
If macForm.QtyOrderedCredited.Text > rs1(0) Then
MsgBox ("PLEASE INFORM SUPERVISOR: " & macForm.QtyOrderedCredited.Text & _
" - " & Trim(rs1(0)) & " = " & (macForm.QtyOrderedCredited.Text - rs1(0)) & _
" " & macForm.UOM.Text)
End If

End Sub

If anyone has any recommendations on better coding, please feel free to input because this is like my first time writing a VB script.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close