Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

populating SQL table from Great Plains Window Data

Status
Not open for further replies.

lbanks1

Programmer
Oct 20, 2005
3
US
I have a table that I created using Enterprise Manager. I want to use this on the Save Button:

Insert Into table name (field names in table)
Select (fields) from open Window

How do I reference the window? I have tried window.windowname.field, me.windowname.field, me.field and nothing is working to get the data into the table.

Yes - I have an ODBC connection setup for ADO and I can query my table in Query Analyzer... Has to be something simple that I am just missing.
 
I am assuming that you want to store selected values/data from an existing GP window into a user created table.

The only way I know how to do this is to attach VBA coding to the save event on the window and then have the VBA coding call the stored procedure that inserts into your table.

 
Have you tried using the VBA DUOS (Dynamic User Object Store) instead? This is much simpler and does not require the use of RetrieveGlobals.dll and ADO to access SQL data.

David Musgrave [MSFT]
Senior Development Consultant
Escalation Engineer
MBS Support - Asia Pacific

Microsoft Business Solutions

Any views contained within are my personal views and
not necessarily Microsoft Business Solutions policy.
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
I have not used DUOS before. I need to get this done today as I am changing positions to another company. Can you give me some solid insight on how to quickly set this up using DUOS?
 
Here is what I am trying to do. It is giving me a syntax error in the objRs.Open portion.

objCmd.CommandText = "INSERT INTO RinVoucherPO (VoucherNum, PONum1, PONum2, PONum3, PONum4, AMT, AMT1, AMT2, AMT3 )" & _
" SELECT (VoucherNo, PONumber, PONum1, PONum2, PONum3, AMT, AMT1, AMT2, AMT3)"
objCmd.CommandType = adCmdText
objRs.Open objCmd.CommandText, objConn, adOpenDynamic, adLockOptimistic, objCmd.CommandType
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top