Can MS choose from list of words?

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
cbv
Newbie
Posts: 10
Joined: Tue Jul 29, 2003 8:00 pm

Can MS choose from list of words?

Post by cbv » Tue Jul 29, 2003 8:08 pm

Hi,

I'm new to the group... :D

Can MS be programmed to present a list of words for the user to choose from? A cursory search of the online manual shows me possibly.. with the Dialog ListBox option?

TIA
Chris

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jul 30, 2003 12:24 am

I will bet the answer is YES, but can you be more explicit with an example of what you are trying to do?

cbv
Newbie
Posts: 10
Joined: Tue Jul 29, 2003 8:00 pm

Post by cbv » Wed Jul 30, 2003 12:42 am

bob hansen wrote:I will bet the answer is YES, but can you be more explicit with an example of what you are trying to do?
Hi, Bob.

I'd like to use MS to automate data entry in a 3rd party app. In a certain dialog of the app, some data _may be_ the same as the previous record. Would be nice to avoid typing that data again.

--
chris

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jul 30, 2003 1:55 am

Will give it some thougt......
Depending on the application you are using, it may be possible for you to create some VB script to read certain fileds in the last record and copy them to the current record.

Much more than I could spend time on here.

It would also depend on the 3rd party application....what program/database/language are you working with?

Oops, I just remembered that there was a sample ODBC script on the MacroScheduler sample script sections under the VB section. I don't have the exact link at this time, but I think I have a copy.....wait one.... YES!..... The sample script is here, uses Northwind database from Access:
=====================================

VBSTART

Function GetCustomerName(CustID)

Dim SQLString

set MyDB = CreateObject("ADODB.Connection")
MyDB.Open "Northwind"

SQLString = "select * from Customers where CustomerID = '" & CustID & "'"
set rsCustomers = MyDB.Execute(SQLString)

If Not rsCustomers.EOF then
GetCustomerName = rsCustomers.Fields("CompanyName")
Else
GetCustomerName = "Not Found"
End if

MyDB.Close

End Function

Sub ChangeName(CustID,NewName)


Dim SQLString

set MyDB = CreateObject("ADODB.Connection")
MyDB.Open "Northwind"

SQLString = "Update Customers Set CompanyName = '" & NewName & "' Where (CustomerID = '" & CustID & "')"
set rsCustomers = MyDB.Execute(SQLString)

MyDB.Close

End Sub

VBEND

Input>CustID,Enter Customer ID:
VBEval>GetCustomerName("%CustID%"),CustName
MessageModal>The Customer Name Is : %CRLF% %CRLF% %CustName%

Input>NewName,Enter New Name:,CustName
VBRun>ChangeName,%CustID%,%NewName%
=======================================

Note this sample just shows how to create an ODBC connections and access the records. It does not address your specific problem.

Hope this helps.........good luck,
Bob

cbv
Newbie
Posts: 10
Joined: Tue Jul 29, 2003 8:00 pm

Post by cbv » Wed Jul 30, 2003 2:16 am

> ...a sample ODBC script on the MacroScheduler sample script sections...

Hi again. I appreciate all your help, Bob. Thanks. :)

Keep in mind... I have not used MS, yet, but would like to know if this solution is available -- before taking the plunge.

Isn't there a simpler solution, maybe something built-in to MS? How about it's Dialog command? I see there's a ListBox option. Can items be added to the ListBox easily, like as I'm running the macro & entering data?

--
chris

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jul 30, 2003 3:33 am

It is possible to populate the ListBox in the Dialogs. But they are usually filled before the dialog is called in the script. They can be filled with variables.

It may be poossible to modify the listbox contents on the fly, but I don't think so. Perhaps someone else will say Yes?

How about some free thinking for a few moments... how does this sound?

1. Enter data into a field
2. Hit a hot key to save the field contents and write it to a file
3. Repeat for fields in the record, pressing hot key on each field to be saved.
4. Save record and open new record

5A. Hit a hot key and populate all the fields that were saved earlier
OR
5B. Be prompted on individual fields about entering from previous record.
OR
5C. Select a group of fields to be entered automatically, and manually enter the rest.

A few more questions, less critical, just trying to get a better understanding of the environment.........
Will you always be selecting the same fields to copy?
Will the fields always be in same positions?
Are keyboard commands available vs. mouse commands to navigate through the fields in the record? To progress through records?

cbv
Newbie
Posts: 10
Joined: Tue Jul 29, 2003 8:00 pm

Post by cbv » Wed Jul 30, 2003 6:57 pm

> Will you always be selecting the same fields to copy?
Possibly. My current concern is a 'text' field that contains multiple descriptions about the record. Each description separated by a comma.

>Will the fields always be in same positions?
Relative to it's window -- yes.

> Are keyboard commands available vs. mouse commands to navigate through the fields in the record? To progress through records?
Yes. 'Tab' moves between fields; Arr-Up/Dn to prev/next record.

Here's a PDL of what I'd like MS to do:
1. Enter any amount of descriptions from a ListBox into a field, each separated by a comma.
2. Update the ListBox, including any new descriptions from the field.
Now the list is ready for use in the next record.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts