![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Sorry for opening the umpteenth thread to this topic, but after three
days googling for every keyword imaginable, i didn't get useful results. I want: ....To populate a combo box on a Outlook 2K3 form with data from an Access 2K3 Database using VBA I have: .... Working VBA-code that allow me to get my data from Access .... Working VBS-code, that allow me to populate my combo box .... No idea how to put these two together in one VBA subroutine I am familiar with VBA in Acccess, I wouldn't have much problems doing that task in a form there but with Outlook, I have no clues... If someone could be so kind and maybe just point me to the correct objects that have to be used, I would be very grateful! Greetings, Stefan |
#2
|
|||
|
|||
![]()
Are you sure VBA is what you want? The usual approach is to put code to handle any UI tasks like that in the VBScript code behind the form, in the Item_Open event handler. It sounds like all you need to do is adapt your VBA code to the VBScript environment by removing any typed variable declarations, declaring constants as needed, etc.
-- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Steffkm" wrote in message oups.com... Sorry for opening the umpteenth thread to this topic, but after three days googling for every keyword imaginable, i didn't get useful results. I want: ...To populate a combo box on a Outlook 2K3 form with data from an Access 2K3 Database using VBA I have: ... Working VBA-code that allow me to get my data from Access ... Working VBS-code, that allow me to populate my combo box ... No idea how to put these two together in one VBA subroutine I am familiar with VBA in Acccess, I wouldn't have much problems doing that task in a form there but with Outlook, I have no clues... If someone could be so kind and maybe just point me to the correct objects that have to be used, I would be very grateful! Greetings, Stefan |
#3
|
|||
|
|||
![]()
Thank you for your fast response! The problem is: I simply don't know,
how to adapt my VBA code to VBS! The code is as follows: Sub GetData() Dim db As Database Dim rs As Recordset Dim i As Integer Set db = OpenDatabase("c:\database.mdb") Set rs = db.OpenRecordset("Query", dbOpenSnapshot) i = 0 Do Until rs.EOF Debug.Print rs.Fields("Name") rs.MoveNext i = i + 1 Loop End Sub If I put this bluntly in my Item_Open() script, I the script throws an error. Stefan |
#4
|
|||
|
|||
![]()
I gave you the basics in my earlier post:
" ... adapt your VBA code to the VBScript environment by removing any typed variable declarations, declaring constants as needed, etc." A typed variable declaration is like this: Dim db As Database You must change it to: Dim db dbOpenSnapshot is a constant not intrinsic to VBScript. You must declare it as a constant or replace dbOpenSnapshot with its literal value. -- Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Steffkm" wrote in message oups.com... Thank you for your fast response! The problem is: I simply don't know, how to adapt my VBA code to VBS! The code is as follows: Sub GetData() Dim db As Database Dim rs As Recordset Dim i As Integer Set db = OpenDatabase("c:\database.mdb") Set rs = db.OpenRecordset("Query", dbOpenSnapshot) i = 0 Do Until rs.EOF Debug.Print rs.Fields("Name") rs.MoveNext i = i + 1 Loop End Sub If I put this bluntly in my Item_Open() script, I the script throws an error. Stefan |
#5
|
|||
|
|||
![]()
What more can I say than: It works!!!
Thank you very much! Stefan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Populate combobox with public folder contact | Pazuzu | Outlook - Using Forms | 4 | March 15th 06 10:27 AM |
Update TO field based on combo box selection | Lisa | Outlook - Using Forms | 0 | March 2nd 06 04:42 PM |
Populate Control Boxes | spydog27 | Outlook - Using Forms | 0 | February 14th 06 11:48 PM |
Dropdown controls - List vs Combo | Don Smith | Outlook - Using Forms | 2 | January 20th 06 06:46 PM |
How to display PO Box field in Business Address Box from contact | Sue Mosher [MVP-Outlook] | Outlook - Using Contacts | 0 | January 18th 06 05:01 PM |