A
Andrew Fiddian-Green
Please excuse my total lack of knowledge but honestly I have never touched
Access before in my life...
I have an own written (exe) application for making price quotations; it has
an automation server interface that allows one to create a price quotation
and add items to it via COM calls. Until now I only have experience of doing
this from a VBA script in Excel that transfers data from spreadsheet cells
into my application. But now I also need to create a similar VBA script for
an Access application to transfer data base fields in a similar way...
The following is the code from my Excel VBA script with some pseudo code
showing what (I think) I need do with Access:
++++
' create application server instance
Dim quoteServer As Object
Set quoteServer = CreateObject("Quotation.Server")
' create a new price quotation
Dim quote As Object
Set quote = quoteServer.CreateQuote
Dim partNo as string
Dim itemQty as string
' pseudo code: select the database
select db = database "abc"
' pseudo code: iterate thru each row of the database
For row = db.rowMin To db.rowMax
' pseudo code: get the part number
select db.row.field.name = "PartNumber"
partNo = db.row.field.value
' pseudo code: get the quantity
select db.row.field.name = "Quantity"
itemQty = db.row.field.value
If (partNo <> "") And (itemQty <> "") Then
' insert part number and quantity into quotation
quote.AddItem partNo & ";" & itemQty
End if
Next row
+++
My four specific questions are how should the real VBA code look for
1) the select db = database "abc"
2) the For row = db.rowMin to db.rowMax / Next iteration
3) the "select db.row.field.name = something" selection
4) the "something = db.field.value" assignment
Any help would be appreciated...
Regards,
AndrewFG
Access before in my life...
I have an own written (exe) application for making price quotations; it has
an automation server interface that allows one to create a price quotation
and add items to it via COM calls. Until now I only have experience of doing
this from a VBA script in Excel that transfers data from spreadsheet cells
into my application. But now I also need to create a similar VBA script for
an Access application to transfer data base fields in a similar way...
The following is the code from my Excel VBA script with some pseudo code
showing what (I think) I need do with Access:
++++
' create application server instance
Dim quoteServer As Object
Set quoteServer = CreateObject("Quotation.Server")
' create a new price quotation
Dim quote As Object
Set quote = quoteServer.CreateQuote
Dim partNo as string
Dim itemQty as string
' pseudo code: select the database
select db = database "abc"
' pseudo code: iterate thru each row of the database
For row = db.rowMin To db.rowMax
' pseudo code: get the part number
select db.row.field.name = "PartNumber"
partNo = db.row.field.value
' pseudo code: get the quantity
select db.row.field.name = "Quantity"
itemQty = db.row.field.value
If (partNo <> "") And (itemQty <> "") Then
' insert part number and quantity into quotation
quote.AddItem partNo & ";" & itemQty
End if
Next row
+++
My four specific questions are how should the real VBA code look for
1) the select db = database "abc"
2) the For row = db.rowMin to db.rowMax / Next iteration
3) the "select db.row.field.name = something" selection
4) the "something = db.field.value" assignment
Any help would be appreciated...
Regards,
AndrewFG