Modules & VBA :: MouseMove Event On Disabled Controls
Nov 29, 2013
I'm using a mousemove event to display help text for controls in my form.This works well, but I'd like to display help text when the control is disabled as well (to explain to the user why it's disabled).is there any way to fire a mousemove event when hovering over a disabled control?
View Replies
ADVERTISEMENT
Aug 7, 2013
I am trying to set event handlers on multiple controls in code. This works:
Code:
Me.Controls("txtPosition" & Right(CStr(iLoop + 100), 2)).OnClick = "=UpdateTaskList(" & CStr(iLoop) & ")"
This doesn't:
Code:
Me.Controls("txtPostIt" & Right(CStr(iLoop + 100), 2)).OnGotFocus = "=PostItGotFocusHandler2()"
The second gives an error: "The expression you entered has a function that <databasename> can't find.
I suspect it may be a parameter mismatch, but the normal GotFocus event handler does not take any parameters.
View 2 Replies
View Related
Mar 5, 2014
Basically I have a class event that works for all controls on any userform.
Its all working fine but I can't add an event to trap the click or mouse move of the userform itself.
Basically so when the cursor moves away from a control the label clears.
User Form Code
Code:
Option Compare Database
Option Explicit
'Define a collection and initialise the commandbutton event class
Private col As New Collection
Private newCmd As New clsEvents
[Code] .....
And here is the class Module
Code:
Option Compare Database
Option Explicit
'catch the event of Commandbuttons
Private WithEvents C0 As SubForm
'Private WithEvents C1 As CheckBox
[Code] ....
View 11 Replies
View Related
Jun 20, 2014
I've got some forms that I've set to lock controls based on an added tag. I have a loop that goes through the entire form and disables (controlname.enabled = false) or locks (controlname.locked =true) all the controls with that tag.
This appears to work fine when the form is on a blank record but when an existing record is opened, the controls that have data in them are no longer locked or disabled (empty controls are still locked). Is there an explanation for this behavior? I don't want to disable the entire form because there are controls that I want the user to be able to always access. I started by just disabling them, then when I noticed the problem I tried locking them instead but it happens with both. Is there another property I can try that will really lock them if they have data in them or not?
View 1 Replies
View Related
Dec 15, 2005
Hello,
How can you disabled a click event on a text box ? I don't want to use ENABLE = false because the background of the texte box comes gray. So, any alternative solution?
Thanks,
Le
View 6 Replies
View Related
Jul 24, 2013
I have a report that tracks scores for our employees. From the report, you can click a button to add a new score in a form or edit an existing score(frmscoretracker). On this form there are two subforms, in a tabbed control to track additional information about the score; what areas were marked down(Trends), and was it a failing score(AutoFail).
When this form opens I have it programmed to only show the subform if there is data in it. The goal being, if I am adding a new score and there is no existing trends or Autofails for this new record, neither subforms will show - I will add an after update even to show either trends or autofail depending on the score recorded. Also, if someone chooses to edit the score, whatever subform with data, will show as well.
When someone clicks to add a new score, opening this main form to a new record, both of the tabs show. However, if the form opens to an existing record, the appropriate tab shows. Here is the code
Code:
Private Sub Form_Open(Cancel As Integer)
'If the subform has a record, the tab is visible, if not, the tab is not visible
If Me.frmtrends.Form.Recordset.RecordCount > 0 Or IsNull(Me.Trends) Then
Me.Trends.Visible = True
Me.TabCtl33.Visible = True
Else
Me.Trends.Visible = False
End If
[code]...
Both tabs are set as not visible in the default settings. Is there something in this code that is triggering then to be visible when there is no record in the main form?
View 4 Replies
View Related
Aug 13, 2015
There are 4 unbound dropdown list box that will have a default value of empty string. All 4 must have values entered (data is required).Once all 4 are required - the bottom 5 text box will become enabled (optional data).Forcing the user to click on a Validation Button
Some users type then use the mouse to select the next.Other users type to select then tab.The trick is: After filling in the 4th listbox and validating all 4 have values, the event must trigger code to enable the 5 optional text boxes below.This provides a seamless data entry environment.
I have been doing this in other places, but the transisition after the last required field is complete gets ugly.If Trim(cmbBoxname1 & "") = vbNullString ' check all 4..If it is the 4th one, the event seems not to happen quick enough for the bottom 5 text boxes to be enabled so the user can continue with data entry.
View 9 Replies
View Related
Mar 18, 2013
When trying to append to a table, I get, "the action or event has been blocked by Disabled Mode!
View 14 Replies
View Related
Jan 10, 2006
i have 15 text boxes named Qty1, Qty, Qty3, etc...
and another 15 text boxes named Comment1, Comment2, Comment3, etc...
i'd like to write an AfterUpdate event code that will apply to all of the Qty controls..instead of write 15 individual AfterUpdate events..
is this possible at all?!
View 6 Replies
View Related
Jan 22, 2015
I have an mdb file that is being used in Access 2013. The menu appears in the Add Ins as it is supposed to and it works for the most part. For some reason, it remains visible but is not clickable/operable after I do the following code. This all works flawlessly in earlier version of Access so it must something peculiar to 2013 (no surprise there....). hat would cause the ribbon to stop working, what to do when it does, and best of all, how to prevent it from occurring in the first place?
This code is for an option box that either prints a report or creates a pdf and then sends the report as and attachment to a CDO generated email. Other than it (seemingly) turns off the menu..THe site won't allow me to post links so the code is an attached txt file
View 2 Replies
View Related
Nov 4, 2013
I have a form with mulitple buttons that run different reports, I've used the mousemove VBA script to show text about the report when the cursor is placed over one of the buttons that all works fine.
Can get it to display a image when the cursor is placed over a button.
It'd just be a screenshot of the report output so the user gets an idea of the layout before they run it.
View 7 Replies
View Related
May 2, 2015
I'm using a dropdown that has the months of the year in it. The user selects a month and the form is then filtered by a date if its the first of whatever month is selected. It works fine but when the filter is applied I cant select the little arrow on the column headings and select the boxes (Select All, Blank, ETC...). It doesn't work on any column, just the apply text filter works but I cant select anything.
It works fine when I clear out the filters on the form. I tried to use vba to set the menusetting property to true and that didn't work either.
View 1 Replies
View Related
Jan 22, 2014
I'm in the middle of writing a multi-language procedure, and in order to populate the label database I would like to cycle all forms (regardless of whether they're open or closed) and cycle all controls within the forms.
View 3 Replies
View Related
Jul 14, 2013
I have a form. I want to move a field and it's label. I need to unhook it from the other fields or I can't.
I found this post on another forum: [URL]
It says, in part, When you create your form, before you do anything else, open it in design view. Right click on the top-most of the stacked controls and choose Layout | Remove on the shortcut menu. All the controls are free to move individually now.
alas, I don't know where the "stacked controls" are or Layout/Remove or any "shortcut menus of any kind". (oh how I long for the simpler days of "ordinary" menus (easily accessible from the keyboard.)
View 2 Replies
View Related
Sep 15, 2014
I have a bit of code that uses controls on a form to batch add records to the tables. Before the code executes, it needs to do a check to make sure that all of the needed data has been supplied.
Code:
If IsNull(txtDateAdded) Then
MsgBox "Please supply the date that the Label record was created"
Exit Sub
Else
If IsNull(cboRecordCreator) Then
[Code] ....
View 1 Replies
View Related
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
Jun 3, 2014
i have created a module under module section of my DB My Report Name : "PURCH VB Query"
the code is as follows : (what is want tell you later..)
Code:
Sub Erlick()
DoCmd.SelectObject acReport, "PURCH VB Query", True
'"PURCH VB Query", acViewPreview, "PURCH VB Query"
For i = 1 To 3
DoCmd.PrintOut acPrintAll, , , , i
Next i
'This is for creating Seperate Text Per Copy in RptHeader Preview End Sub
i've placed a TextBox in my report named Text25 to the value :
=+1
properties-->data-->running sum--> Set to OVer all
i've also set a textbox in my report named CpyWord to the value : =IIf([Text25]=1,"Original Buyer Copy", IIf([Text25]=2,"Duplicate File copy",))
Now what is want is Three Copies of Report with Two copies marked seperately as per above IIF statement
As i want Three Copies with each Rpt-header as Different Text
Possible solutions (ba donna no a script) How do i refer to Report's control after Docmd.SelectObj.... if any facility then i can do easily thru the dazzling for next loop How do i increase Report's control Text25's value, if three copies r there I know there are many events in Report
I've stucked over this point. My all App in db is ready
View 10 Replies
View Related
Oct 8, 2013
I'm working on a code that checks all blank/null text fields and combo boxes in a form and notifies the user if a field is not filled. The code below works if all fields are required, but I can't use it on forms that have fields that are not really mandatory. I've read somewhere on the net to use tags on the controls i want to skip checking, but that's where i get lost.
Code:
Dim stdResponse As Variant
Dim ctl As Control
' Enumerate Controls collection.
For Each ctl In Me.Controls
' Check to see if control is text box
[Code] .....
View 8 Replies
View Related
Aug 12, 2014
Is there a way to stop the controls from flickering when the timerevent fires?
What doesn't work:
Code:
Application.Echo False
Docmd.Echo False
TimerEvent on the current form
TimerEvent on a different form
Using Windows API:
Code:
Private Declare Function SetTimer Lib "user32" etc
Private Declare Function KillTimer Lib "user32" etc
Each of these events flicker the controls on my forms. The effect is worse when the form background contains a picture.
View 13 Replies
View Related
Jun 22, 2013
I have this code that works. I have a form with 3 tabs. When I select the middle tab I am prompted for password but if I click the 3rd tab I am not.
Code:
Private Sub TabCtl9_Change()
Dim strInput As String
Dim ctl As Control
' Hide controls on tab until correct password is entered
For Each ctl In Controls
[Code] .....
View 8 Replies
View Related
Jul 14, 2014
I have a problem with formating controls in a form. As a example, I inserted a tree view control and adobe reader control. After I've resized them manually in a design form, I switch into form view and they both resize automatically to their own size (don't know where it gets from).
In the result, I can't obtain the required width and height. How can I make them resizable to my own preference?
View 14 Replies
View Related
Jun 20, 2013
I have a sub form that allows users to add staff to a project team, once added it populates a table which updates the subform showing the selected employee. I am trying to enable a delete function that allows users to remove an employee from the project team in the subform showing selected staff. Here is the code I have so far, but it doesn't work;
Code:
Private Sub Command4_Click()
Dim dbs As Database
Dim rs As Recordset
Dim sqlstr As String
Set dbs = CurrentDb
sqlstr = "DELETE tbl_CapexStaff.* FROM tbl_CapexStaff WHERE CAP_ID = Forms!frm_Switchboard.CAP_Live"
dbs.Execute (sqlstr)
End Sub
View 4 Replies
View Related
Feb 12, 2015
I am trying to create a customizable report that would allow the users to choose fields. I have a pretty common code that I found online and adapted it, but it fails on the first SetReportControl function.
The error reads: Run-time error 2465: Application-defined or object-defined error
Could it be something as simple as an incorrect reference? I have checked multiple times, but I am stumped.
Code:
Option Compare Database
Option Explicit
Sub MakeReport()
[Code].....
This is a trial run, in the end I need to be able to open a report, then adjust the Report controls within 1 or more subreports inside the main report. That is a battle for another day.
View 14 Replies
View Related
Jun 2, 2014
I have placed an unbound subform on a form. I have the following code which loads in different datasheet to the subform:
'Loads in NewQuery
Me.data.SourceObject = "query.NewQuery"
'Loads in NewQuery2
Me.data.SourceObject = "query.NewQuery2"
etc.... this works fine to show these queries but i want to know how to reference the fields on the datasheet.
for example one of the fields in NewQuery is "ID"... When clicked i want to run code... normally on bound subform i could go for example ID_Click()... msgbox(me.ID)
how can i reference these other fields on unbound???
View 3 Replies
View Related
Mar 14, 2014
I have a subform which lists a set of records. In the footer section of the subform, I have a number of controls which display calculations based on the records present.
The number of records in the subform will change (reduce). Basically, this is a review / approval function, the idea being that each record will be checked and approved, which will then remove it from the list.
So eventually, all of the records in the subform should disappear (the subform is requeried each time the user approves a record)
I want to be able to hide the controls in the footer section once the subform has been cleared of all records.
But not sure
a) how to determine when the subform's recordset reaches zero and
b) what event to use to fire the code to hide the footer controls.
This is my basic attempt :
Code:
Private Sub Form_Current()Dim ctl As Control
For Each ctl In Me.FormFooter.Controls
ctl.Visible = Not (Me.Recordset.EOF)
Next ctl
End Sub
But it doesn't work (it only seems to fire when the subform is loaded, not when it is requeried after each approval?)
I've tried Form_Query, Form_DataChange and Form_DataSetChange but no joy with those either.
View 6 Replies
View Related
Jan 14, 2014
I have a DB with TblInspector and TblViolation Data. Here is what I am having trouble with. On my form I have a combo box named Inspector and a text box named ARNumber. What I would like to have happen is anytime that I select John Doe from combo box Inspector it pulls his ARNumber from TblInspector and saves his ARNumber in TblViolation Data.
I have fields Inspector and ARNumber in my TblViolation Data. I am pretty sure it is an After Update Event. I just don't know what code to put where. This is what I currently have on my combo box. It pulls the number and displays it in the text box on the form but does not save it to the table.
Private Sub Inspector_AfterUpdate()
Me.ARNumber = Me.Inspector.Column(1)
End Sub
View 2 Replies
View Related