Modules & VBA :: Assign Outlook Task Item Loop

May 29, 2015

I have a query that formats data into a list of personnel who are coming due for refresher training. The query is formatted to provide me all the details that I need to create an outlook task, and assign it to the person. I tried creating a button on my form to create a record set of that query, and then create / assign a task to each person based on the values from the recordset.

Code:
Private Sub SendTasks_Button_Click()
'Create the recordset and set it to the appropriate query
Dim rst As DAO.Database
Dim rstData As DAO.Recordset
Set rst = CurrentDb
Set rstData = rst.OpenRecordset("SendTasks_qry")

[Code] .....

Basically, the compiler stops at "Dim myOlApp As New Outlook.Application" with the error: "Compile error: User-defined type not defined"

View Replies


ADVERTISEMENT

Modules & VBA :: Access 2010 / Loop Through Query To Assign A Value To A New Field?

Aug 16, 2013

Using Access 2010: I have a query with four fields: ORG_NAME, PERS_NAME_LAST, CountOfORG_NAME, and BdMbrCount. There are a couple hundred companies in the database with 1-7 people associated with each company. I need to number each person so that they have a number, 1-7 in the MemberCount field of my query.

I have my query connected to VBA code.

I have experimented with code that I have found on the forum, just to see if I could get something to work and I am getting “Undefined function ‘BdMbrCount’ in expression. I am trying to pass [ORG_NAME],[PERS_NAME_LAST] to my function and assign the value of BdMbrCount to a new field in my query, BdMbrCount.

Code:
Function BdMbrNumber()
Dim qdf As DAO.QueryDef
Set qdf = CurrentDb.QueryDefs("YourBdMbrsRRecognizedQry")
'Set rst = CurrentDb.OpenRecordset("SELECT [ORG_Name],[PERS_NAME_LAST],[CountofORG_NAME], [BdMbrCount] FROM YourBdMbrsRRecognizedQry")
Dim ORG_NAME As String

[code]....

View 14 Replies View Related

Modules & VBA :: Outlook Move Item

Jun 27, 2014

Right I have the code in place but it will only work first time out look is opened, unless I have a msgbox on the first line and, I cant work out how to make it work with out it, obviously the msgbox isn't code doing any thing but it must be setting focus or some thing, here is the code

Dim strID As String
Dim olNS As Outlook.NameSpace
Dim olMail As Outlook.MailItem
Dim objAtt As Outlook.Attachment
Dim objDestFolder As Object

[code]...

View 3 Replies View Related

Modules & VBA :: Send Meeting To Outlook - Address Item Line Causing Error

Mar 24, 2014

I'm trying to have a command button send info on the form straight to Outlook as a meeting. So far, the code below works apart from the address bit. I need the code to automatically add the same 2 email addresses as recepients everytime.

Error message highlights the red line below with the following message:

Runtime error '438'
Object doesn't support this property or method

I'm new to VBA, so don't understand what is wrong here. The reference is set, I've tried different permutations of the "To:" & "Recipients.Add" for the email address with no joy.

Code:
Private Sub cmdSend_Click()
Dim outApp As Object
Set outApp = CreateObject("Outlook.application")
Set outmail = outApp.CreateItem(olappointmentitem)

[Code] .....

View 10 Replies View Related

Assign Employees To Task Then Remove Employee From List Of Available For Other Tasks

May 6, 2015

I need the ability to assign employees to a different task in each of four different timeslots on a daily basis. What I would like to do is as I assign an employee to a task in timeframe 1, I would like for them to become unavailable to assign to another task in the same timeframe.

For Example: Three employees to assign to three tasks at the 8 AM to 10 AM time slot.

Employee
Task
Time
Assigned

Emp 1, Emp 2, Emp 3
Task 1
8 AM to 10 AM
Emp 2-Task 1

Emp 1, Emp 3
Task 2
8 AM to 10 AM
Emp 3-Task 2

Emp1
Task 3
8 AM to 10 AM
Emp1-Task 3

It would be nice to set this up in a form where my person doing the scheduling can assign an individual to a task and that individual name disappears from the combo boxes, list boxes, or is "greyed-out" in a listing of employees available for the time period for the remaining assignments.

View 7 Replies View Related

Tables :: Task Tracking For Making Item

Aug 24, 2013

Im trying to create a database to track who worked on what item and on what date, with four tasks required to complete the item.To give an example:I have a factory that builds Lego models, for each model there are four steps:

1)Unbox Parts
2)Sort Parts
3)Build
4)Check build

Any employee can work on any task, and multiple tasks can be done by the same employee.Having a completed item table with a field for each task, and a date for each task, with one to many relationships from employee id to each task type. This failed as I needed many to many, so I made a junction table to link them, and this is where I get a little muddled.

Do I need a table of task types, then a table tracking each task to feed into the item table, or is there a simple solution I'm overlooking?

View 4 Replies View Related

Queries :: Automate Outlook Task To Export Common Query Every Day

Jun 29, 2013

I've created an outlook task to export a common query I do every day, is there a way to automate it so it will happen automatically without me pressing Run?

I use office 2007 on a company laptop with tight network restrictions (so no Windows Task Scheduler)..

View 1 Replies View Related

General :: Assign Next Item To Next User?

May 6, 2014

I have a list of inventory (SR #s) in a excel under column A. And also there are 20 users using ms-access accessing by their user names. If a user completes one item, the next item from the excel should automatically goes to the next available user. After the item allocated to the particular user, under column B the user name should come and in column C there should be a comment saying "Done" Can i have a code for this in SQL or VBA.

View 2 Replies View Related

Forms :: Way To Assign By Design Certain Item Number To Given Control?

May 12, 2015

The code I am modifying looping through Me.controls collection to identify appropriate control types. Is there a way to influence the order (sequence) of that traversing? Or in different words, is there a way to assign by design certain item number to a given control?

View 4 Replies View Related

Modules & VBA :: How To Force Windows Task Bar To Always Be On Top

Apr 14, 2014

I write Access 2010 apps in VBA that require no knowledge of Microsoft Access on the part of the user. My forms contain all the necessary controls to use the program without relying on any of the Microsoft Access toolbars. I call this "de-Microsofting" the app. When I prepare the .accdb program to create a .accde app, I uncheck every checkbox (Options/Current Database) except "Compact on Close". This works well, but it also hides the Windows taskbar at the bottom of the screen. Some of my users need to be able to jump from my app to others (e.g., Excel) and back without having to exit my app. How can I force the Windows taxkbar to always be on top using VBA or, possibly, some setting?

View 4 Replies View Related

Modules & VBA :: Scheduled Task On Windows Server

Apr 20, 2015

I have a vbs-script that opens my access database db.mdb and runs the module "Export":

dim accessApp
set accessApp = createObject("Access.Application")
accessApp.OpenCurrentDataBase("D:Datadb.mdb")
accessApp.Run "Export"

accessApp.Quit
set accessApp = nothing

This works fine as a scheduled task on a Windows 7 computer.

Is there a way to make this work on a Windows Server 2008 R2 ? When I double click the vbs-file, the file opens instead of runs. And when I create a scheduled task, nothings happens.

View 2 Replies View Related

Modules & VBA :: Send Task To Recipient Using Late Binding

Oct 2, 2013

I am trying to send tasks to other people using access vba. I had used before in my database but was using early binding and now through version issues of office I am trying to recreate the code using late binding, however I am getting various problems with certain lines of code.

Primarily .datedue line I am getting run time error 438 object does not support

Below is my code:

Public Sub ASB5PostponedTask()
Dim olApp As Object
Dim olTask As Object
Dim olDateEnd As Date
Dim ToContact As Object
Dim olTaskOwner As String
olTaskOwner = "e.grainger"

[Code] .....

View 1 Replies View Related

Modules & VBA :: Scheduled Task - Run Macro To Send Report Out?

Feb 3, 2014

I have a report that I run manually from my computer every day.

This report is created by a macro in microsoft access, then it runs a VBA macro to send it out..

Is there a way that I can add this as a scheduled task since I usually forget to send it out?

View 3 Replies View Related

Modules & VBA :: Can't Assign A Value To Object

Nov 15, 2013

I am trying to use Access 2007 popup calendar to populate a combo box with a selected date. When I select the date on the calendar the above error appears.

Code:

Private Sub Calendar9_Click()
'Set Date to the selected date and hide the clalendar.
MAssBDate.Value = Calendar9.Value
MAssBDate.SetFocus
Calendar9.Visible = False
End Sub

[code]....

View 2 Replies View Related

Modules & VBA :: Assign Specified Date Into SQL Statement

Jan 28, 2014

I want to create a table via SQL. This table should contain records that begin after a specified date.

Something is wrong with this syntax.

Code:

Sub TEST()
Dim t As Date
t = 1 / 3 / 2014
DoCmd.RunSQL "SELECT TRP.Customer, TRP.Material, TRP.Product_Class, TRP.TRP as Price, TRP.Valid_from, " & _
" TRP.Valid_to INTO [New_Prices] " & _
" FROM TRP " & _
" WHERE (((TRP.Customer)= 1223) AND ((TRP.Valid_from)>#t#))"
End Sub

View 14 Replies View Related

Modules & VBA :: Cannot Assign A Value To This Object (Textbox)

Mar 27, 2014

Not sure whats going on here, nothing on the table that stops this from working. I just get Run-time error "2448 You can't assign a value to this object" When the code runs.

Code:
Private Sub Form_Open(Cancel As Integer)
Dim rst As DAO.Recordset
MySQL = " Select max(ID) from TblUserQry"
Set rst = CurrentDb.OpenRecordset(MySQL)
Myid = rst.Fields(0) + Int(Rnd(1) * 10)
Me.txtMyID.Value = Myid

End Sub

View 6 Replies View Related

Modules & VBA :: Assign Password To Buttons In Forms

Feb 26, 2015

I have a form called departments . one that form i have 5 buttons. I want this form only to open when some logs onto the database . The buttons represent each department ...

1. sales
2 purchasing
etc etc

Is it possible to assign a password to those buttons so each department has security to their own form ...

View 8 Replies View Related

Modules & VBA :: Assign Column Width In Flag?

Apr 29, 2014

How to implement the procedure of clicking on the flag and hide the field in VBA? I know that want to assign - ColumnWidth=0.

Сomplete procedure fails.

View 10 Replies View Related

Modules & VBA :: Assign Value To Enumerated Control Property

Sep 13, 2014

I want to retrieve and assign values of a control's properties by naming the properties. So for example:

Dim myHeight As Long
Dim myPropertName As String
myPropertyName="Height"
myHeight = 315
Forms!Myform.MyTextBox.Height = myHeight

I can retrieve the value using Eval:

Debug.Print Eval("Forms!MyForm.MyTextBox." & myPropertyName ) gives 315

How can I do the inverse operation, ie.assign the value of a property whose name I have in a string MyPropertyName? I mean other than a brute-force approach with a huge Case.

View 3 Replies View Related

Modules & VBA :: Assign Values To A Table Through Code?

Jun 24, 2015

I have a table (tblPrinterSelection) with three fields: Autonumber, DocType, PrinterSel

There are three types of values for "DocType"; "Document", "LargeLabel", "SmallLabel"

I want to assign a "PrinterSel" to each type of "Doctype", which basically means that the user selects the type of document and then the printer in a form that has the code below and then I need the code to automatically update the table.

Code:
Dim PrintSel As String
Dim DocType As String
'Assign a value to the printer selected variable
PrintSel = Me.lblPrinterSelected.Caption
If IsNull(Me.frmDocType) Then
MsgBox "No document type selected."

[code]....

What i am looking for is code that would pick the value for "DocType" and "PrintSel" assigned here and add them to the table so that I can use that info later.

I am only looking to have three rows in that table so if the "DocType" does not exist then a new row is created but if it does, only the value of "PrintSel" is updated.

I should end up with something like this:

1 Document Epson
2 LargeLabel HP
3 SmallLabel Canon

How can I do this?

View 3 Replies View Related

Modules & VBA :: Public Function To Assign A Macro To All Buttons With A Certain Name

Jan 23, 2014

I have built an access application that contains a set of buttons along the top of every form that serve as navigation.* These buttons each perform the same function on every form they are on. (menu opens the main menu, etc) I have database macros to assign each button the same function but I still have to go through each form and manually assign them. I was wondering if it was possible to define a public function that on db open will look for all buttons with a certain name and assign them the macro. (so all buttons called cmdmainmenu will have the OpenMainMenu macro assigned and so on).Before you go there, I have already tried the navigation form and set all forms as subforms.

View 5 Replies View Related

Modules & VBA :: Assign OnClick Event To Control Through Code

May 27, 2014

Visual Studio IDE environment and I have been working with Access VBA for almost a year now.

I am very used to generating my form controls in runtime and being able to create some cool user interface interactions by being able to say btnExample.OnClick += MyDynamicClickFunction

MyDynamicClickFunction(Object sender, EventArgs e).... code

Any way to assign functions to the events of already made controls on a form. Probably during the load event?

Now I have found that there are many ways to replicate Visual Studio's features by accessing User32 and replicating them

View 2 Replies View Related

Modules & VBA :: Declare Public Variable And Assign A Default Value

Nov 7, 2013

I want to define a public variable and i am using the following code but it gives me Compile error Invalid outside procedure.

Code:
option explicit
public ABC1 AS VARIABLE
ABC1="FALSE"

View 7 Replies View Related

Modules & VBA :: Complex Do Loop / For Each

Mar 11, 2014

I have to loop thru 2 recordsets.I need to first determine the quarter , then retrieve a value from each of the 6 fields for that quarter and compare that value against a previous years value that is also stored in the table for each quarter.the following is the field names not the field value.

Tier 1 2 3 4 5 6 PrYr
Qtr1 Q1T1, Q1T2, Q1T3,Q1T4, Q1T5, Q1T6 .385
Qtr2 Q2T1, Q2T2, Q2T3.Q2T4, Q2T5, Q2T6 1.25
Qtr3 Q3T1, Q3T2, Q3T3,Q3T4, Q3T5, Q3T6 .774
Qtr4 Q4T1, Q4T2, Q4T3,Q4T4, Q4T5, Q4T6 .333

if Qtr1 = Q1T1 = 0.44 Q1T2 = .50, Q1T3 = 1.45, Q1T4 = 3.00, Q1T5 = .25, Q1T6 = 6.0

So I need to be able to set the value of PrYR = .385 and compare against the value of the 1st qtr for each tier for Qtr1.Then go to Qtr2 and repeat the process but grap the Q2 PRYR value = 1.25 and compare against all Tiers for Qtr2.As so forth for each quarter.then I need to compare the value of the PrYr and if it is the following then

If PctYrlyIncrease< Tier1 Pct (Q1T1) Payout = 0
elseIf PctYrlyIncrease> Tier1 Pct (Q1T1) and < Q1T2 then
Sum(TotalNetUSExp * T1E)
ElseIf PctYrlyIncrease> Tier2 Pct (Q1T2) and < Q1T3 then
Sum( TotalNetUSExp * T2E)

and repeat for each Tier per Each Qtr.Here is my code so far:

Code:
Public Function BkOvrCalc(ByVal gContractID As String) As Long
Dim curDB As DAO.Database
Dim strSQL As String, strSQL1 As String

[code]...

View 3 Replies View Related

Modules & VBA :: Cannot Get Loop To Advance

May 11, 2014

Here is the code:

Private Sub Form_Load()
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("select * from tblpatient, dbOpenDynaset)
If Not (rs.BOF And rs.EOF) Then
rs.MoveFirst
Do While Not rs.EOF
' do stuff
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End If
End Sub

I have watched it step through on debug and it does everything right for the first record, but it seems to come back to the same record.

View 3 Replies View Related

Modules & VBA :: Loop In Text Box

Feb 23, 2014

I have a form where a textbox has shows the NameNo from the NameNo column in a db. At the moment I am using a dlookup to set the textbox = to the NameNo, but obviously this is only returning the 1st value in the column. How to get this form to automatically display each NameNo, creating a pdf of the form and then moving on tto the next nameno. I have the code to make the pdf working so far, all I need now is to figure out how to use the textbox to loop through all the NameNo's in the table.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved