Modules & VBA :: ActiveX Monthview - Reset Value To Today On Certain Events

Jul 23, 2013

I'm using this control to allow users to select a date as input to a subform. The control is working just fine, but I have a problem, I need to reset the value to today on certain events (for instance a reset button to reset the values back to today). I have tried:

Me!calThru.Today
and
Me.calThru.Value = Date
and
calThru.Value = Date

but with no success.

View Replies


ADVERTISEMENT

Modules & VBA :: ActiveX Control Events Aren't Raised While Calling Its Methods From The Open Event

Oct 9, 2013

We have an ActiveX grid control, 10Tec iGrid, written in VB6. One of its method, Group, used to group rows, raises the AfterAutoGroupRowCreated event so the developer can adjust the look and contents of every group row created during the automatic process of grouping.

When our ActiveX grid is hosted on an MS Access form and we call the Group method while populating the grid in the form's Open event, the AfterAutoGroupRowCreated event isn't triggered. But this event definitely works as expected in other development environments, and even in MS Access if we call Group from the form's Load event.

Is it a well know issue of MS Access, when any events of ActiveX controls aren't triggered while "executing" the Open event

View 1 Replies View Related

Forms :: Display Number Of Events Taking Place Today

Dec 17, 2013

I'm creating a database for a music store which also does music lessons. In the header I wish to display the number of lessons that are taking place each day, the number will be dynamic as the number of lessons vary from day to day. I obviously have a table with all the lessons that have already taken place, as well as lessons that are taking place in the future.

I've attached the header (isn't the final version) as an example.

View 1 Replies View Related

Today Or Before Today Date Criteria

Feb 23, 2007

what do you put in the criteria in a date field to show records with a date = to today or less?

View 3 Replies View Related

Modules & VBA :: SQL Make Existing Date Into Today?

May 20, 2015

I've been using Allen Browns method [URL] to copy form and sub form data, and it works perfectly after some adaptation.

It changes dates to today from whatever the date 'was'.. perfect.. however, as I'm still learning SQL, is there a way, to make the copied subform's date into today as well...this is my adapted code from the SQL part..

Code:
'Duplicate the related records: append query.
If Forms!FRMREGISTERMain!frmJustSubRecordsDEPOSITS.Form.RecordsetClone.RecordCount > 0 Then
strSql = "INSERT INTO [tblSplits] ( TopLineID, TransDate, Memo, Category, SubCategory, Credit, Debit) " & _

[Code].....

As I'm still learning, am I right in thinking that I'll use SELECT and/or WHERE somewhere in there?

View 3 Replies View Related

Modules & VBA :: Video Capture Using ActiveX Controls

Jan 10, 2014

Using Activex controls for capturing video from a webcam or similar. Just looking for a snapshot that I could then forward via email from access.

Ive seen commercial licenses for an activex control. The form Im imagining would have a window showing the live video with a snapshot button where we could store the image as a jpg for example and then generate an email forwarding on the image. It seems possible!

View 1 Replies View Related

Modules & VBA :: ActiveX Component Can't Create Object

Jan 12, 2015

I am trying to connect to MS Access from MS word using the following code but getting the above error message:

Code:
Sub GetDataFromDataBase()
'allocate memory for the database object as a whole and for the active record
Dim myDataBase As Database
Dim myActiveRecord As Recordset

[Code] .....

View 2 Replies View Related

Modules & VBA :: Referencing ActiveX Control In A Class

Jun 26, 2015

I'm using Access 2003. In "References" (Tools > References > Browse...), I've added in "Microsoft Windows Common Controls 6.0 (SP6)" (c:windowssystem32mscomctl.ocx).

I've then created/inserted an instance of the control "Microsoft ListView Control 6.0 (SP6)" on a Form ("MyForm") and given the listvew control the Name "MyListView".I wanted to decorate MyListView with some custom methods so I've created a new class module ("DecoratedListView") which contains a member field called "lvw".

I want 'lvw' to point/reference to MyListView, but I don't know what reference type to use in its declaration. Importantly, I also want to capture lvw's ColumnClick event.

I've tried:

Code:
Public WithEvents lvw As Object
Public WithEvents lvw As Control
Public WithEvents lvw As MSComctlLib.ListView.2
Public WithEvents lvw As MSComctlLib.ListView
Public WithEvents lvw As CustomControl

and none works when I

Code:
set lvw = Forms!MyForm.MyListView

The first try (Object) doesn't even compile. I get the exception "Expected: identifier"
The second try (Control) doesn't compile either. I get the exception "Object does not source automation events"
The third try (MSComctlLib.ListView.2) doesn't compile and throws the exception "Expected: end of statement"
The fourth try (MSComctlLib.ListView) compiles but fails at runtime with the exception "Type mismatch". Using TYPENAME() on the control returns "CustomControl".
The fifth try (CustomControl) compiles but fails at runtime with the exception "Object or class does not support the set of events".

I can't believe I'm the first person to have tried to capture an ActiveX Control's events in a separate class.

View 1 Replies View Related

Modules & VBA :: Ignore Certain Events In A Form?

Apr 9, 2014

In my database I have module that checks if tick box is True and then closes all the forms and kicks the user out of the database. However in most of my forms, there is a custom Save command in the On Click of cmdSave button and the Form_BeforeUpdate. The save requires certain things to be true so naturally if a user has made a change to a record, the form won't allow you to close it if you haven't saved your changes or undone them.

Is there anyway I can get my module to bypass certain events in the form?

View 7 Replies View Related

Modules & VBA :: Before / After Delete Confirm Events

Oct 4, 2013

I'm using Access 2007..I have a table that contains transaction records from a bound form.When the user enters a certain type of transaction, I create a corresponding transaction in the after insert event.

Example
User record - tranId = 1, tranAmt = 10, tranType = DISB, tranAssocID = 0
My record - tranId = 2, tranAmt = 10, tranType = RECV, tranAssocID = 1

When the user deletes a record, I want to delete my corresponding record using the tranAssocID ( delete * from tran_tbl where tranAssocID = (the tranID of the user's record)

Problem:
1) I don't know how to save the tranID of the users record
2) I don't know how to reference the saved tranID in the delete statement.

I'm using the before delete confirm event to try to save the users tranID to no avail.I'm using the after delete confirm to delete my record in a case statement - acDeleteOK...I tried to save the value of the ID in the form (Me.tid) to a public long variable, a hidden field on the form, and a temporary variable to no avail.

View 8 Replies View Related

Modules & VBA :: Mouse Events On A Form

May 27, 2015

I have a parts order form (FrmORDER)with a list of parts selected stored in it. e.g Part #, Part Description, Qty, Price etc

I also have assemblies stored with the same detail that are composed of individual parts.

What I would like to do is

Open formA if I do a single click (to select a new part or assembly)
Open formB if I do a double click (to open the contents of the selected assembly in the order form

It would seem that the following series of events occurs

When the user double-clicks a control other than a command button: MouseDown → MouseUp → Click → DblClick → MouseUp

Hence I can't actually open formB with a double click unless I remove the single click event.

View 10 Replies View Related

Modules & VBA :: To Check If Excel Files Are Updated Today Then Run A Macro

Jun 26, 2015

I have a database which I've creating but now want to make others available to update - in the past this has not gone well! The database uses data from two excel sheets and the problem has been people do not always check if these have been updated today before running and therefore the database gets loaded with old data.I have found code that will check and display a message showing datelastmodified for a file but what i'm trying to find is code which will check both files' datelast modified, if they are modified today then run the update macro, if one or both are not modified today, then to display a message saying that the excel is not updated.

View 7 Replies View Related

Modules & VBA :: Object Or Class Does Not Support Set Of Events

Mar 19, 2014

I have this below which some people cant run and some people can. All are using 2010 runtime version. Apart from the one guy who can run the macro who has full 2010 version. I have 2010 runtime installed and i can also run the macro fine.

Private Sub Option12_Click()
On Error GoTo Option12_Click_err
Dim CntlPay As String
Dim Lable As String
CntlPay = "D"

[code]....

View 1 Replies View Related

Modules & VBA :: How To Link A Combobox Value To Two Single Events

May 28, 2014

I explain briefly what is my task, When the user selects a different name from the list, I would like to link it automatically with the current Date() . I want to do it for every single name of the field so that in case I need, it would be possible to track for how many days that particular name of the list has been clicked.

I explain it better…My DB aims to monitor some procedures that have 3 status, these are:

On Working,
Expired
Revoked

Given the above I would like to track when every single procedure starts is “on working” and when it ends it. I want to automatically link every name of the combobox with an event that update a field of a table that monitor the beginning and to another that monitor the end (when another status is selected). After that my aim would be to calculate the diff between the two in order to have a number of the days that every single procedure is stuck into a single status. Do you think is something feasible? I hope to have explain it well… If you need I can try to explain it better

Is there a way, in access db or in its VBA, to capture the two columns of data from the combo box so that can monitor them?

View 14 Replies View Related

Modules & VBA :: Object Or Class Does Not Support Set Of Events

Oct 21, 2013

I have wrote a database in access 2010 and the database works fine for me (I am the db admin with full control).I gave the database to a group in which most of them also have no issue with the file. They are able to use the database with no issues..One of those members gets an error message when completing the initial step in the database: (select a drop down item from a combo box)

Code:
The expression After Update you entered as the event propoerty setting produced the following error: Object or class does not support the set of events

Something I cant seem to understand is why is this happoening on 5 machines but not on the 6th, they all have the same PC set up so there should be no error on one particular machine.

View 6 Replies View Related

Modules & VBA :: ActiveX Component Can't Create Object - Sending Email

Jun 27, 2015

I am using the following code but when i run it produces the following error.

Run-time error '429':

ActiveX component can't create object.

then on debug it highlights the line

Set objOutlook = CreateObject("Outlook.Application")

I have searched online and already tried a suggestion to ensure that mictosoft outlook 14.0 object library is selected in the VBA references.

Code:

Dim objOutlook As Object
Dim objMailItem As Object
Const olMailItem As Integer = 0
Set objOutlook = CreateObject("Outlook.Application")
Set objMailItem = objOutlook.CreateItem(olMailItem)

[Code] ....

View 4 Replies View Related

Modules & VBA :: Copy A Record Without Triggering Form Events

Dec 30, 2014

I have a form which has been in use for some time now, and works extremely well for all users; as part of a recent update to that form, I added a few events to various controls; most of them are message box prompts to remind the user to do something, but one is automatic entry of text into a memo field when another field is updated, and it is really this last one that is causing an issue.

There is a command button on the form which has an embedded macro, created using the wizard - it is probably the last, or one of the last few buttons that have a macro as opposed to VBA.

Essentially, when this button is clicked, I would like a duplicate of the current record to be made (thus giving it an Autonumber ID of its own), and if possible I would like this to be done without triggering any of the after update events on the form. Is there a way to disable these events and copy a record in its entirety, re-enabling the events at the end?

View 2 Replies View Related

Modules & VBA :: How To Count Number Of Events Based On Type

Dec 3, 2014

I have a table that contains many records of events. I've already created a multiple item form based on the table. My form contains 2 textboxes for input of a date range and a dropdown box to select "yes or no".

What I am having difficulty with is the query that will count the records by type insert it into the recordsource such that the multiple item form will appear like this:

Event Type| Count
Input | 4
Output | 2
Update | 3

How do I go about doing so? I have been testing with this simple query:

Code:
Private Sub Command8_Click()
Dim Task As String

Task = "SELECT EventType, Count(EventType) FROM Final GROUP BY EventType;"
Me.RecordSource = Task
End Sub

But the column that contains the count keeps appearing as #name?

View 12 Replies View Related

Modules & VBA :: Reset Rowsource For Comboboxes

Nov 18, 2014

I have a form with many comboboxes. The comboboxes need to have their original rowsource set to a table in my database. However, when the user selects a value in a combobox, it is programatically fed into a SQL string which serves to populate a subform. This part all works great.

However, I'm trying to reset the comboboxes as well so that options will "narrow down" until only a single option is possible. So far, I have:

Code:
Private Sub cmb_Author_Change()
Dim strSQL As String
strSQL = "SELECT tbl_Records.RecordName, tbl_Records.RecordDistinction, tbl_Records.Title, tbl_Records.Author, " & _
"tbl_Records.ProjectManager, tbl_Records.[Site Name], tbl_Records.ChargeCode,

[Code] ....

GetWhere() is the portion that feeds info from the comboboxes to the Finder string.

The red highlighted bit is the part I'm working on. Obviously, once I figure out the proper syntax, all of the other
comboboxes will be set up the same way.

What's funny is that in testing (all of the data currently input is simple and allows me to select options where I know what the response will be in other boxes), when I change Author and go to use cmb_RecordName, it replies that "the record source 'My Data' specified on this form or report does not exist" (where 'My Data' represents real data).

So, clearly, it is finding the data, just not using it as a record source, but rather believing that the name of the recordsource is the value.

View 9 Replies View Related

Modules & VBA :: Creating Events Log - Compare Username On Report To Table

May 22, 2015

I'm working on creating an events log. In my table I've got a field that pulls the individual's username (that they use to log into the computer) and logs it against their log entry.

As part of my query (for my daily events log report) I'm pulling up said username.

I'd like to give access to the specific user to edit his (and only his) entries from the report, but I'm getting a type mismatch with the below code:

Code:
If me.UsernameID = "KraussLJ" Or Environ$("Username") Then
DoCmd.OpenForm "frmShiftLog"
DoCmd.FindRecord Me.ID, acStart, , acSearchAll, , acAll
Else
MsgBox ("You are not authorized to edit this entry")
End If

(before you ask, "KraussLJ" is our ops manager who insists on having final editorial control over the shift log before sending it higher up the chain)

I can get the msgbox to run if I block out the

Code : Environ$("Username")

, but beyond that I'm a little stuck. Should this be a dlookup function or am I overanalyzing this way too much?

View 2 Replies View Related

Modules & VBA :: Capturing Events On A Frame Within Multi Page (tab) Control

Aug 23, 2013

I have a form with a tab control and an option group (frame). When I built the layout of the contents of the first tab, the frame responded properly to click events. Now that I have copied them onto the tab control, the events seem to disappear.

(When I check the events for the controls, they are all still there, and selected by the Properties table).

I know it's probably one of the "doesn't use Access very much, does he" type of situations, so how to get these controls working again!

Here is the Form Code listing.

Option Compare Database
Option Explicit
Sub SetSourceDescription()
If Me.frRunMode.Value = 0 Then
Me.lblSourceType.Caption = "Source for this run will be the Extract .pst file(s)"

[Code]...

View 3 Replies View Related

Modules & VBA :: Reset Autonumber After Record Deletion

Jul 16, 2015

We need to reset the autonumber after the last record is deleted.

For example:
2006
2007
2008

if 2008 gets deleted, we want the autonumber to reset back to 2008 rather than move to 2009.

Is this possible? This is the code we are using but cannot get the string to recognize the variable. If the variable is replaced with a number, it works, but it defeats the purpose of adding the plus 1 to the last autonumber.

Code:
Private Sub Command0_Click()
Dim RLMax As Integer
Dim Statement As String
RLMax = DMax("[id]", "Table1")
RLMax = RLMax + 1

strSQL = "Alter table table1 Alter Column Id Autoincrement(RLMax,1)"
DoCmd.RunSQL strSQL
End Sub

I realize we don't want to depend on the autonumber for anything other than a row identifier, but the table is setup that it is important for the rows to be sequential if the last record is deleted. Only if the last record is deleted.

View 12 Replies View Related

Modules & VBA :: Change / Reset User Password

Jul 10, 2014

I have this code to change user password

Private Sub Command3_Click()
If IsNull(Me.cboEmployee) Or Me.cboEmployee = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.cboEmployee.SetFocus
Exit Sub
End If

[Code] ....

But it doesnt change the password....

View 3 Replies View Related

Modules & VBA :: Reset Autonumber And Keep Sequence After Deleting Record

Feb 28, 2014

I have a Microsoft Access database with SQL Server backend with 10000 records in my table, I have a autonumber field and in my database the purpose of the autonumber field is just to keep the record sequence (not to treat as a unique identifier) and I don't want to use a number field to manually enter the sequence. Whenever the record is deleted or the user won't save the record, it put gaps in the record sequence, Is there any way to refresh the autonumbers automatically "After delete confirm" event or "After Insert/update" even.

View 13 Replies View Related

Modules & VBA :: Reset Autonumber Each Time Delete / Append Records In A Table?

Oct 25, 2013

I need to reset the autonumber each time I delete/append records in a table. Best way?

View 5 Replies View Related

Modules & VBA :: Find Date Which Is 6 Months Back From Today Date

Jan 27, 2015

I want to find out the last 6 months date from todays date. So as todays date is 27th january 2015 so the code should give me the date which is 6 months back from todays date so it will be something like 27th July 2014.

View 1 Replies View Related







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