Modules & VBA :: Passing Image To Another App?

Dec 27, 2013

I want to use an On Click event on an image field on a subform to fire up either Windows Photo Viewer or Corel PaintShop Pro with that image active - but don't really know where to start. DoCmd, Shell ?

View Replies


ADVERTISEMENT

Modules & VBA :: Changing Image Path - Set Picture Property Of Image

Dec 4, 2014

I have a form that I would like to update a picture on using VBA. The source of the picture path is in part a query that is not bound to the form. So far I have the following code that is pretty much working, but with a couple flaws.

Code:
Private Sub Form_Current()
LoadDefaultPicture
End Sub
Sub LoadDefaultPicture()
Dim db As DAO.Database

[Code] ....

This is working. However, when I change the record the picture flashes the current picture once and then loads the new picture. It is like it reloads the current picture then loads the new one. I'm hoping there is a way to get rid of the flash.

Also, the code fails here:
strDefaultPictureName = rs.Fields("AttachmentName")

When the query does not return a record. I can definitely fix this by adding an if statement to check for a record, but I'm kind of perplexed at why it is failing at that line. I would expect it to assign an empty string to that variable name and then fail on the next command where I try and set the ".Picture" property of the image.

View 8 Replies View Related

Modules & VBA :: Passing Information From One Form To Another

Sep 25, 2014

I have created Form1 with a button and after I click the button Form2 appears (frm_Rollover_Progress). Form2 is a (poor mans) progress indicator that makes some labels visible after a section of a query has run. I have set the first label on the form to Me.lblProgress1.Visible = True but I keep coming up with Compile Error - Method or data member not found. However, when I put a button on the second form and copy in the exact same code then Me.Label1.Visible = True works. I have tried to SetFocus to an item on Form2 but still does not work.

'Open progress form to show progress indicator
DoCmd.OpenForm "frm_Rollover_Progress", acNormal, , , acFormReadOnly

'Add current changes to Total Changes table

Me.lblProgress1.Visible = True
Me.Label1.Caption = "10%"
DoCmd.OpenQuery "qry_Change_AddedQX2", acViewNormal, acAdd
Me.lblProgress2.Visible = True
Me.lblProgress3.Visible = True
Me.Label1.Caption = "30%"

View 2 Replies View Related

Modules & VBA :: Passing Variables To A Sub Routine

Jan 13, 2014

I have a public sub routine which requires parameters to be passed to it when I call it from an access form. When I try to enter the code to call the sub I get a compile error. I've also tried calling it from another sub in the same module but get the same compile error - see below.

Code:
Sub EmailData(Datafile As String, To_mail As String, CC_mail As String, Subject_mail As String)
'code to use variables passed in
End Sub

[Code]....

View 4 Replies View Related

Modules & VBA :: Passing TempVar Value Into A Table

Dec 13, 2013

I have a form in which the user selects a combobox and this value becomes a tempvar called "un" on clicking a command button I need the value of "un" to be passed into a table."un" is a number.Here is what I have so far.....

Code:

CurrentDb.Execute "INSERT INTO timedata(startedby) " & _
" VALUES(" & TempVars!un & ")"

but seem to get syntax errors all the time.

View 6 Replies View Related

Modules & VBA :: Passing Variable From One Database To Another

Jan 6, 2015

I need to pass a variable from one Access Database to another

The scenario is I have a item number in one database that I need to use to open a form in another database,

I can open the database using vba, currently launching a BAT file that copies the latest version database to a local drive and then opens it,

Is there an easy way to pass the variable after this has completed?

View 1 Replies View Related

Modules & VBA :: Passing New Data From One Form To Another

Jan 19, 2015

I have a form called frmSchedule. Within this form, I have a combo box called cmbCD. I have code in the cmbCD NotInList Event. If the user inputs a number not in the list, the folowing code opens up a new form (frmPatients). The user can now add a new record to the database.

Code:
Private Sub cmbCD_NotInList(NewData As String, Response As Integer)
Dim Result
Dim Msg As String
Dim CR As String

CR = Chr$(13)

[Code] ....

I got this code and it works. However, when the user inputs a new number in frmSchedule, the NotInList event takes them to frmPatients. The users then have to re-type the number in frmPatients.

My question is: Is there a way I can trasfer the NewData from frmSchedule into frmPatients, so the users don't have to re-type the number?

View 2 Replies View Related

Modules & VBA :: Passing RecordSet As A Parameter

Sep 19, 2014

I'm trying to the following sub to automate the creation of RecordSets but I'm confuse how to get it done properly.

Public Sub OpenRecordSet(SQLString As String, NameRecordset As Object)
Set NameRecordset = New ADODB.Recordset
NameRecordset.Open SQLString, adOpenStatic, adLockOptimistic

I want to pass the name of the recordset as a parameter but I don't know how to set it.

View 1 Replies View Related

Modules & VBA :: Animate A Box Image?

Apr 11, 2014

im after trying to make an image on a splash screen rotate around on its centre as a loading icon?

Im guessing i will need a loop on the form opening?

View 1 Replies View Related

Modules & VBA :: Passing Combo Box Control To Procedure

Nov 21, 2013

On my form I have a combo box where the user can select the sex of a person. I had set the row source of the combo to a table, tblSex and this works fine. Now I want to programatically add the table entries ( simply male or female) to the row source, having set the combobox to value list. I cant see how to pass the combobox and tablename parameters and I am getting an error on form load "The expression you entered as the event property setting produced the following error: UserDefined type not defined" The calling procedure from frmPeople is

Code:
'---------------------------------------------------------------------------------------
' Procedure : Form_Load
' Author : Administrator
' Date : 21/11/2013

[Code].....

I think the way the parameters combobox and tablename are passed is incorrect. I want to write a robust procedure which I can use for each of the comboboxes on my form.

View 7 Replies View Related

Modules & VBA :: Passing Variables And Retrieving Results?

Jul 9, 2014

I wrote this module

Option Compare Database

Option Explicit

Public Function OdometerInput(varodometer As Variant) As Long
Dim varKilometres As Variant
varKilometres = varodometer * 1.609344
OdometerInput = CLng(varKilometres)
End Function

It works fine in the immediate window (although I haven't just fathomed what to do with null values and such) But my question which I am sure will be 'easy when you know' is how do I pass the variable to it from a text box on a form and retrieve the data in another text box on a form.

View 4 Replies View Related

Modules & VBA :: Calling A Function And Passing Variables

May 29, 2015

I have never tried passing variables while calling a function so I don't know what the heck I'm doing. I'll give a simplified example of what I'm trying to do. The second variable vRank is reporting properly but the first one vID gets "stuck" on whatever the first item in the listbox is.

Code:
Dim vrt As Variant
Dim upSQL As String
For vrt = 0 To Me.List1.ListCount - 1
If Me.List1.Selected(vrt) = True Then
Call ChangeUp(Me.List1.Column(0, vrt), Me.List1.Column(1, vrt))

[Code] ....

View 3 Replies View Related

Modules & VBA :: Passing TempVar To SELECT Query

Feb 25, 2014

Picture, if you will, a table with multiple fields, each of which contains the date of a certain action in the process tracked by each record. I have a standard report format that will be used to view the progress of the actions. I want to be able to sort the report - on demand by non-technical users - by whichever date field they choose.

I've created a form with a combo box that is linked to a table with the name of each field in the source table. A Macro has been configured to open the form when the report is opened, which will prompt for the selection of the sort field. That value is then captured into a TempVar.

When the user clicks OK control passes to a procedure in a module that executes a SELECT statement (SQL) that configures the Query that is used for report generation. The "ORDER BY" portion of the statement needs to be modified with the name of the sort field desired. If the statement is hard coded as, for example:

...ORDER BY Main.[Initiated Date] DESC;

it works fine. I want to use the value of the TempVar to provide the name of the date field (ex.: [Initiated Date]), but I can't determine the correct syntax to get the statement to accept it. Concatenating doesn't seem to work, and I've searched high and low for hints on the web. Here's one version of what I've tried (and which fails):

"...ORDER BY Main." & [TempVars].[SortParm] & ";"

The error returned by the above version is: "Object doesn't support this property or method"

(SortParm is the name of the TempVar, and it is correctly populating, and keeping, the value I need from the form.)

View 3 Replies View Related

Modules & VBA :: Passing Parameter And Date To Query

Nov 10, 2014

I have the following Visual Basic code which I am using to dynamically pass the parameters "SAFP" and date 10/31/2014 to the query:

Option Compare Database

'------------------------------------------------------------
' Run_Risk_Assessment_Report
'
'------------------------------------------------------------
'Original macro code
Function Run_Risk_Assessment_Report()
On Error GoTo Run_Risk_Assessment_Report_Err
Dim dbs As DAO.Database
Dim test1 As DAO.QueryDef

[Code] ....

When I run the query, i get the error "Item not Found in this collection"

View 14 Replies View Related

Modules & VBA :: How To Add Icon / Image To List Box

Aug 15, 2013

is there any way to adding icon/image to the list box of ms access. what is the way?

View 1 Replies View Related

Modules & VBA :: Identify Image Control Name?

Nov 8, 2013

I have a global function which I have hooked onto the onClick event of controls. Currently I am using commandButtons as my control of choice. In my function I can then reference Forms.ActiveControl which is no problem.

However, for lots of reasons I really need to use Image controls. Now, my problem. Image Controls have an Onclick Event, but they do not get focus so the Forms.ActiveControl will not work.

How can I identify the image control that has generated the click event if the control itself does not get focus and so cannot be referenced by ActiveControl? Working on a possibly work around, but could do with the best brains in Access on the case!

View 3 Replies View Related

Modules & VBA :: Multiple Image In A Form

Jun 18, 2013

How do i actually store and display my image in a form which works when i click on a item in the listbox and it will display the image i want.Currently i'm using a unbound form with listbox and rowsource from Queries.When i click on the listbox it gave me

"you referred to a property by a numeric argument that's isn't one of the property numbers in this collection."

This is the code i tested

Quote:

Private Sub List6_Click()
If Me.List6.ItemsSelected.Item(3) = "DF" Then
Me.Image32.Visible = True
End If
End Sub

the (3) is referred to the 3rd column of the listbox right? is it because the rowsource is from a query that's why i have that error or because the query contains multiple different tables?

is there any simple way to insert image into access and it will appear in just 1 image box ? and depending on which item i click on the listbox the image will change?

View 8 Replies View Related

Modules & VBA :: Passing Variables To More Than One Field As Query Criteria?

Feb 25, 2014

My problem is as follows, i have created a report that calculates the total volume of FSC Materials. The user picks two dates from Calender controls that the report will range from. However the needs have now changed and i am required to make the report filter further based on user input, the problem i'm facing is that i cannot figure out a way to pass values from different variables to the report separate from another here is the code i would usually use to pass data to a query/report:

Code:
Private Sub MonthlyFSC_Click()
Msg = MsgBox("Select the Start and Finish Dates you wish to Query.", , "Start / Finish")
Start = adhDoCalendar()
Finish = adhDoCalendar()

[Code] ....

However i am now trying to do this, but it gives me an error as it is trying to pass the values to one field:

Code:
Msg = MsgBox("Select the Start and Finish Dates you wish to Query.", , "Start / Finish")
Start = adhDoCalendar()
Finish = adhDoCalendar()
sql1 = "[ORDER DATE]<#" & Format(Finish, "MM/DD/YY") & "#"
sql2 = "[ORDER DATE]>#" & Format(Start, "MM/DD/YY") & "#"

[code]....

It is performing incorrectly within the case select and passing the wrong criteria, as it will only display results that meet the default values' criteria. However the date criteria is not be passed either.

View 4 Replies View Related

Modules & VBA :: Error Passing Variable To Class Module

Jan 30, 2014

I am trying to pass a boolean variable to a class module

Code:
Set rps.ViewS = View

the code in the module that this in theory is calling reads as

Code:

Private ViewC As Boolean

Public Property Set ViewS(ByRef ViewA As Boolean)
Set ViewC = ViewA
End Property
Public Property Get ViewS() As Boolean
Set ViewS = ViewC
End Property

However I am getting the error message

Quote:Definitions of property procedures for the same property are inconsistent, or property procedure has an optional parameter, a ParamArray, or an invalid Set final parameter.

View 6 Replies View Related

Modules & VBA :: Passing Parameter To A Query - Data Sent To A Table

Jun 5, 2013

I have a function that when called transfers a query recordset to an excel spreadsheet then emails it. At the end of the function I use code to write the date sent to a table. Each time the function is called I only need records in the query that have been modified since the last time the function was called. I have a field in the query 'LastModified' with a criteria '>[Enter Date]'. I then look up the date in the table and enter it manually. I know how to look up the last date sent in table using code but getting the >#SomeDate# in the query with VBA.

Code:
DoCmd.TransferSpreadsheet acExport, , "qryUpdateWebmaster", _
"C:SubmarinersUpdates_Sent" & fname & ".xlsx", True, "Webmaster_Update"

View 1 Replies View Related

Modules & VBA :: Passing Date Strings Into Access Chart

Sep 11, 2013

I would like the user to be able to select the months he wishes in case they want to look at calender year, financial year or just a custom group of months. If I use the wizard and pick dates say the start and end of the year I get the following code in the row source of the chart control:

Code:
SELECT (Format([DatePaid],"MMM 'YY")),Sum([TotalPaid]) AS [SumOfTotalPaid] FROM [Q_AllCust_Gross] WHERE ([DatePaid] BETWEEN #01/01/12# AND #31/12/13#) GROUP BY (Year([DatePaid])*12 + Month([DatePaid])-1),(Format([DatePaid],"MMM 'YY"));

So I decided all I needed to do was replace the dates in the above code with my own global varible which i would pass custom dates into via a form. Which I called getds() and getde()

Code:
SELECT (Format([DatePaid],"MMM 'YY")),Sum([TotalPaid]) AS [SumOfTotalPaid] FROM [Q_AllCust_Gross] WHERE ([DatePaid] BETWEEN >=#getds()# And <=#getde()# ) GROUP BY (Year([DatePaid])*12 + Month([DatePaid])-1),(Format([DatePaid],"MMM 'YY"));

View 4 Replies View Related

Modules & VBA :: Passing Variables To Make Table Query

Sep 29, 2014

Access 2010 vba - I'm trying to pass a start date and end date to a date field in a make table query, and use the 'between' operator on that date field.

So I have a criteria on the date field like this "Between [dtStart] and [dtEnd]" and if I run the query manually it asks for 2 values and then works fine.

Here's the code I'm trying to run:-

Set qdef = db.QueryDefs("qryTest")
qdef.Parameters("dtStart") = StartDate1
qdef.Parameters("dtEnd") = EndDate1
Set rs1 = qdef.OpenRecordset(dbOpenDynaset, dbSeeChanges)

and I get the error "3219 Invalid Operation" on the last line.

View 2 Replies View Related

Modules & VBA :: Passing Data From Query To Textbox On A Form

Jan 7, 2014

I have a form with a date field, when the user creates a new record, I would like the date field to automatically fill with the most up-to-date date from the Orderdate table.

Basically I need the code to do the following when a new record is created;

Search the Orderdate table for the most recent date and then auto fill the date field on the form with that date!!!!

My thinking so far...

Private Sub Command34 - where would you set this event on the properties i.e. Before update or On Got Focus ?

Docmd.OpenQuery "QryFindMaxDate"

I'm not really sure how to pass the date to the text box on the form,

End Sub

View 7 Replies View Related

Modules & VBA :: Passing Parameters To Report Doesn't Work

Feb 23, 2015

I have a query that sums up the number of parts used. This works fine.

I want to be able to limit this query to parts used after a specific date.

I have in my report

DoCmd.OpenReport "Part Totals Report", acViewPreview, , "[Part Date])>= " & SQLDate

The report is bound to a query that has 2 group by fields, 1 count field a a further field, a date field ([Part Date], that I put a default criteria on. This field is not displayed. If I don't put a criteria on this field disappears when I close and open again.

I pass a date to the program via a form and this ultimately ends up in SQLDate. When I run this I get promted to enter [Part Date] even though I'm setting it equal to SQLDate above. I can out garbage to a proper date in here either way the report picks up the default date entered in by the query.

1. Get rid of all of the parameters off the query.

2. Then you can use the Where Clause of the DoCmd.OpenReport code to specify the parameters based on your variables.

1.Not sure what this means but when I get rid of the criteria for the parameter the field disappears (I'm setting the show field to no as I don't want totals group by date). Getting rid of the field gives me all parts used.

2.I think I'm doing this in the above but will bow to superior knowledge!!

or is it I can't pass a parameter to a report run by a query that is grouping fields together to produce a count.

Incidentally once the report has been run (albeit with the wrong parameters) and I go into design mode and look at the property sheet for the report the correct filter is there (i.e., the date that has been input) but it quite clearly ignores this.

View 1 Replies View Related

Modules & VBA :: Display Background Image Via Message Box

Mar 17, 2015

I have a report which is an invoice I have a button on the report to reprint It . Now if this is a duplicate Invoice I need to add a background Image ,something like a duplicate stamp . I have added a message box which says" is this a Duplicate Invoice" .If the answer is yes then I want to display the backgrond image and print the report .If the answer is no, then print report without background image

View 2 Replies View Related

Modules & VBA :: Image In Output To Word Document

Jul 18, 2015

We need to replicate an Access report we have in Microsoft Word. The report has a fixed, small image in the header and so we embedded it in the report (it is not in an external file). To put this image in the Word document the only way we have come up with is shown in the code below.

Code:
Dim apWord As Word.Application
Dim doc As Word.Document
Set apWord = CreateObject("Word.application")
doc.Shapes.AddPicture "G:ImagesSinful Banner.bmp", False, True, 0, 0, 540, 42

Which requires an external image file. We really would like to avoid this. We could make a template Word document, but that too would be an external file. We know how to put this image in a table as an OLE object, but can't find any way to get it from the table into the Word document.

View 12 Replies View Related







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