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 Replies


ADVERTISEMENT

Modules & VBA :: Storing A Single Record In A Single Dimension Array?

Sep 8, 2014

Any Single line of code available?

View 2 Replies View Related

Modules & VBA :: Sending A Single Email To A Single Record In A Query

May 15, 2014

I am trying to create a form with a button attached to each record that would allow the user to click the button and it would automatically open outlook and fill in the TO:, SUBJECT: and BODY: fields. Here is the code that I currently have:

Code:
Private Sub Command33_Click()
Dim strEmail As String
Dim strMsg As String
Dim oLook As Object
Dim oMail As Object
Set oLook = CreateObject("Outlook.Application")
Set oMail = oLook.CreateItem(0)

[code]...

There are two issues I keep running into:

1. This code opens outlook and populates all of the fields but pastes the email incorrectly. Instead of pasting just the email (email@email.com) it pastes the html tags as well (email@email.com#mailto:email@email.com#) which means that the user would have to delete everything between the #'s in order to send the email every time.

2. I currently have the email BODY pulling from a table but this obviously limits what I can do. I would like to simply encode the BODY within the VBA code. The setup I am looking for is:
one paragraph
a blank line
a hyperlink to a website
a blank line
another paragraph

View 9 Replies View Related

How To Link 2 Combobox In The Access

Feb 22, 2014

i want to know how to link 2 combobox in the access like id i chose a department in the other combobox show me the list under that department and the other think how i can create a search button to the date and to the department i want and how to create a button to calculate from many tables.

View 2 Replies View Related

General :: How To Get Value From Combobox And Link It To Print

Sep 6, 2012

What i need to be able to do is write vba to find the value inside the comboxbox and then either:-

1. Run a macro with the same value that is in the combobox
Or
2. Run a set of reports and print them off but are linked to the combobox value.

The combobox name is ODTyper
The combobox control source is ODType which is a field in TblType
The combobox row source is SELECT [TblType].Model FROM TblType;
The value inside the combobox are in the format of TE4700
The name of the macros are in the format of TE4700
The Main form is called FrmOrderDatabase.

Plus somehow i need to get the value of the combobox and link it to print off the correct reports.

View 9 Replies View Related

Forms :: 2 Combobox With One Textbox Link Each Other

Dec 17, 2013

I already try to create 2 combobox with 1 textbox where there are link each others.. i try follow and edit some tutorial from here still not working..

I have status combobox (combo0), analisis combobox(combo6) and price text box (text8). i don't know what wrong with my sql.

Here I attach the file (two table) with the code..

Note : Harga=Price
.................................................. ................................................
Option Compare Database

Private Sub Combo0_LostFocus()

'Check if curent record is a new adn that the states combo has not changed
'warn user and determine desired action
'Reset suburbs combo and text box if user wishes to change states

If Me.NewRecord = True Then
Me.Combo6.Requery

[Code] ....

View 4 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

Forms :: Single Column Combobox To List Values From Multiple Fields

Apr 8, 2013

I have a data base with names, email IDs, phone numbers of 5 types(example quality, security, IT,finance etc) of person from ten different project teams. I created a basic form for the end user to enter values and created fields for each of the person's name, email ID etc based on the personal type( liek quality, IT, finance etc) on each team. The background table contains records of almost 200 people now.

All of these people will be trained for one task and some will be trained for multiple tasks. I know how to make the combo box allow multiple values/selections but, i cannot list out all 200 personal names in the combobox's rowsource/value list. Is it possible to combine all different name fields and list out all personal(of one team), so that the end user can just select multiple names for that team who have been trained and so on. i need to set the rowsource of the combobox to the values of all personal from one team so the team leader can just go select who has been trained and who has not.

View 1 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 :: 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 :: 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 :: 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 4 Replies View Related

Forms :: How To Link Combobox Between Form And Subform To Only Show Selected Filtered Data

Apr 1, 2013

I have a suppliers table and a products table. Two forms, Stock form with combobox to list Suppliers and a sub form with combobox that lists Products.I want to select a supplier from the Stock form and then the combobox in the subform to only list products directly sold by the Supplier.Have dabbled in SQL as follows:

SELECT Products.ProductID, Products.ProductName
FROM Suppliers INNER JOIN Products ON Suppliers.SupplierID = Products.SupplierID
WHERE ((Stocksubform.SupplierID=Stock.SupplierID))
ORDER BY Products.ProductName;

View 2 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 :: 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

Modules & VBA :: Single Criteria In Where Statement

Jul 15, 2014

If the following works for a single criteria in a where statement.

Code:

Set rs = CurrentDb.OpenRecordset("SELECT * FROM tblProcedures WHERE ProcedureID = " & lngMoveUpID, dbOpenDynaset)

What would a second criteria look like.

View 6 Replies View Related

Modules & VBA :: How To Pass Only Single Dimension Of Array

Jul 31, 2014

Now the getrows is working fine at my end. Now I have a different problem at hand:

Sub Test2()
Dim myrset As Recordset
Set myrset = CurrentDb.OpenRecordset("SELECT * FROM Holidays;")
myrset.MoveLast

[Code]....

Recordcount is coming fine
Manual Array is also giving the right result
But the Index method is giving the wrong value. Why?

(Holidays table is just having the values in the array only ie. #08/15/2014# and #08/29/2014#)

View 7 Replies View Related

Modules & VBA :: Mail Merge For Single Record

Feb 18, 2015

I have an access .adp project which is linked to a sql server tables (2008 r2), I have a button on an access form which I click and successfully gets customer details based on a query. What I wanted to know is when I am viewing a specific record i.e. details for Patient Number X, when I click on a mail merge button from their record form can the mail merge document only open with their details not all customers?

I have tried to delve into vba and modules to acheive this but I am a newbie.

View 4 Replies View Related

Modules & VBA :: Print Single Report From Form

Mar 11, 2015

I'm trying to print a Report specific to the record i'm viewing on my Form. I've created a Report linked to the Table - "SCJobsheet".I've created a button in my Form;

Name; cmdSCJobsheet
Caption: Print Record
OnClick: [Event Procudure]

[code]...

The Report is opening but shows Every record (Not just the one I'm viewing in the Form.

View 12 Replies View Related

Modules & VBA :: How To Open Table In A Single Form

Dec 15, 2014

I am using Access 2003. I would like to be able to open a versatile form that can open any selected table in data sheet form. Currently I am using Command Button with the names of the tables as the trigger. Looking for VBA that would change the form's Record Source to a selected table and add all the fields of that table to the form on open. I figured that I can use the OpenArgs to get the form Record Source to be assigned, but how do I assign all the fields of the table to be dropped into the form?

View 10 Replies View Related

Modules & VBA :: Retrieving Single Value From SQL Server Table (DLookup)

Jan 30, 2014

Front end Access 2010, back-end SQL-server 2008 R2.

Normally I retrieve a certain value by Dlookup("myvalue", "mytable",...)

or

strSQL = "SELECT myvalue FROM mytable...;"

Set rs = CurrentDb.OpenRecordset(strSQL, 4)

But is there any faster way to retrieve a single value from an SQL-server table, beside doing doing the select by a stored procedure running through a pass through query, then open a recordset

Set rs = CurrentDb.OpenRecordset("mypassthroughquery")

just to retrieve ONE value?

I could not find something like DLookup("...) for an SQL-Server or in T-SQL.

View 3 Replies View Related

Modules & VBA :: Way To Display Table In A Single Row Separated By Commas

Jun 18, 2013

Code:

Private Sub CommandButton1_Click()
'Insert database table into document

Selection.Range.InsertDatabase Format:=11, Style:=191, LinkToSource:=False, _
SQLStatement:="SELECT * FROM `tblNoonan`" & "", _
DataSource:="N:TorrentSetupNGS.accdb", _
From:=-1, To:=-1, IncludeFields:=False
End Sub

The code runs and displays like this:

xxxx yyyyyy
xxx yyyyyy
xxx yyyyyy
xxxxxx yyyyyy
xxxx yyyyyy
xxxxxxx yyyyyyy
xxxxxxx yyyyy
xxx yyyyyy
xxxx yyyyy
xxxxxxx yyyyyyy
xxxx yyyy
xxxxxx yyyyyy
xxxx yyyyyy
xxxxxxx yyyyyy

Is there a way to display the table in a single row separated by commas:

View 1 Replies View Related







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