Which Event Property?
Dec 12, 2006
I have a subform (subform1) which allows me to select a value which then dictates which record is shown in the other subform (subform2). I want to run a macro every time subform2 has a different value -- without me having to click anywhere in subform2. I have tried to attach the macro to every place I can think of and it just doesn't seem to run. I am thinking it is because subform2 isn't receiving the focus. How do I give subform2 the focus and which event property should I be trying for?
View Replies
ADVERTISEMENT
Jul 11, 2013
I am starting to explore VBA and Modules. I recently found a relativly simple way to add an Audit Log to a database without adding two tables for each table as outlined by Allen Browne.
I used a set of code from fontstuff.com and it works great, except when using a sub form. I belive that it is most likely because the use of the Tag property looks at the subform as a control but it holds no value. I am thinking the VBA needs to be altered or the BeforeUpdate command need to specify what form to look in.
The Before Update code is
Code:
Public Sub Form_BeforeUpdate(Cancel As Integer)
Code:
If Me.NewRecord Then
Call AuditChanges("SubForm_ID", "NEW")
Else
Call AuditChanges("SubForm_ID", "EDIT")
End If
End Sub
AuditChanges is the Module Event name and CustomerID is the unique identifer for a Subform.
View 1 Replies
View Related
Aug 16, 2013
when the Form Property "selectionchange" kicks in?I am trying to use this to run an event procedure. I have a sub form datasheet which contains a date, and when the selection is changed from one record to another in the sub form, I would like to run an event procedure that updates certain fields on the main form, according to the date.I have put msgbox in the event procedure, but it doesn't trigger when the selection is changed? or am I misunderstanding the property?I have also tried got focus, lostfocus, beforeupdate, but they only trigger when the record is changed, not just when the selection is changed.
View 4 Replies
View Related
Dec 15, 2014
I have a report, on a control tab, on a main form.
On the form are two buttons: one to show all items, and one to filter them based on a boolean field called showitem.
The buttons work with the code below.
What I want to do but cannot seem to figure out is to have the report default to no filter.
The bound query has no criteria.
I'm trying to set the filter property via the on open or on load event and even if I isolate the report, cannot seem to reach it.
Code:
Private Sub b_hide_items_Click()
Me.Profile_Timeline_wNotes_subreport.Report.Filter = "timeline.showItem <> 1"
Me.Profile_Timeline_wNotes_subreport.Report.FilterOn = True
Me.Profile_Timeline_wNotes_subreport.Requery
End Sub
Private Sub b_show_all_Click()
Me.Profile_Timeline_wNotes_subreport.Report.Filter = "timeline.showItem = 0"
Me.Profile_Timeline_wNotes_subreport.Report.FilterOn = False
Me.Profile_Timeline_wNotes_subreport.Requery
End Sub
View 14 Replies
View Related
Feb 5, 2014
I tried to dynamically set image OnClick property to function with couple of attributes. Everything works well, but... it launches the function automatically without any mouse click! What is causing this? I want to execute the function only on the result of mouse click.
Piece of code:
Forms!Form1.Controls("Image" & i).OnClick = fclick(PiltID)
Private Function fclick(u)
DoCmd.OpenForm "Form2"
Forms!Form2.Image0.Picture = u
End Function
View 6 Replies
View Related
Jan 11, 2005
ERR: The expression AfterUpdate you entered as event property setting produce the following error: Return without GoSub....
can someone help me...why..b'coz b4 this i'm using the same coding but it can work for another several form....
View 3 Replies
View Related
Nov 24, 2014
Code:
The expression On Click you entered as the event property setting produced the following error: Procedure declaration does not match description of event or procedure having the same name
Now this is the error message that I am constantly getting from any command button I hit on a certain form. Here is the code of the form.
Option Compare Database
Option Explicit
Public inputCSV As String, ORG As String
Private Sub CopyToTableBt_Click()
Debug.Print "Sub Execute calling ImportCSVForConfederation inputCSV="; inputCSV; " ORG="; ORG
ImportCSVForConfederation Me.CSVs, ORG
[Code] ....
I changed the names of the buttons, reconstructed the code under those names, went to the modules and changed names, made sure that a sub o function name is not duplicated in the project... But helas the error is still there. It used to work and suddenly does not work.
View 2 Replies
View Related
Jul 14, 2007
I have a problem. The problem is that I have a form contains two list boxes controls and a calender control. The calender control is invisible by default.
When I click a Show button, to show the calender contol, it appears but behind the list boxes controls. How can I allow it to fully appear on top of all the controls in the form.
Thanks,
View 2 Replies
View Related
Jun 26, 2005
I have never used the tag property but while reviewing some design stuff it occurred to me that maybe I am overlooking it's usefulness and was wondering how some of you may have used it...?
View 8 Replies
View Related
Jun 6, 2005
Please pardon my ignorance, but how do I set up a ActiveX calendar in Access? The help files are missing from the version of Access 2000 I am using, and I really don't know what I am doing. I would be grateful for any help with this.
Thanks.
View 3 Replies
View Related
May 8, 2007
hello,
I have a txtBox. Its backColor property changes according to what I do on the form. Now, when I close the form and reopen it, the backColor is not the same one with which the form was closed.
Ex. red, green
if I close the form having the backColor = green, then when I reopen it, it changes to red.
Can anyone tell me what I am missing
Thank you
View 4 Replies
View Related
Oct 23, 2007
Hi all
I have searched through this forum and on google, and I know that I can refer to a combobox's column property IN VBA by
[myform]![mycombobox].column(1)
When I do this in SQL, it complains that there is an "unidentified function" (column). What am I doing wrong?
View 3 Replies
View Related
Aug 1, 2005
How do I set the Required property for field that already exists via SQL. I'm thinking along the lines of: ALTER TABLE table1 ALTER COLUMN field1 text(50) NOT REQUIRED.
But this doesn't work, any clues?
View 5 Replies
View Related
Jul 17, 2007
I'd like to create a table with 240 fields. I know that the max is 255, however, I'm getting a message "property value too large" after I've created 114. Any ideas? All the number fields are byte size. Thanks!
View 10 Replies
View Related
Aug 12, 2005
I build a form with Combo Boxes, and can not find "DropDownList property".
Can anybody help me.
Thanks
View 2 Replies
View Related
Nov 14, 2005
I guess I have too many columns in my database and I'm getting the error message "Property value is too large" when trying to open the database table. When I was using Access 2000, I was still able to open the database but using Access 2003, the database will not open. Is there a way around this so I can open the table to fix it?
View 14 Replies
View Related
Mar 3, 2006
What I'd like to do is for my combo boxes to say something like "Select One" when the form is first loaded, until the user opens the box and selects something. My combo boxes work fine now, but they are currently empty when the form loads.
From my google research it appeared that the OnLoad property would probably help me do what I want, but I can't seem to find this property anywhere in Access. It's not anywhere in the property window and the help search doesn't return any results.
I'm using Access 2003 from MS Office Professional Edition 2003.
Am I missing an upgrade or does my version not have this property, or am I just missing it?
View 2 Replies
View Related
Jan 12, 2005
Hi all
I have a lstbox on a bound form. the lstbox is based on a query. I want the first item in the box to be selected. This is what ive used:
Private Sub roll_class_select_AfterUpdate()
DoCmd.Requery "lststudents"
Me.lststudents.Selected(0) = True
End Sub
But then the form gets stuck. None of the other controls will work. The first list item is selected but it then wants to be the centre of attention and everything else can bugger off.
Any ideas as to how I can fix it??
Damon
View 6 Replies
View Related
Oct 21, 2005
When I attempt to run my results page with paging I get the following error:
ADODB.Recordset error '800a0cb3'
Object or provider is not capable of performing requested operation.
/slug/revslug/Administrators/AdminReports/Timesheet/TechnicianAllocation.asp, line 185
I have included a few key lines of code:
Code:strDBPath = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & Server.Mappath("/slug/RevSLUG/DB/TimesheetDB.mdb") & ";"if strTechName = "All" Then strSQL = "Select " & cstr(strReportType) & ", SUM(Hours) as SumOfHours FROM Results WHERE (PerDate >= #" & cdate(strStartDate) & "# and PerDate <= #" & cdate(strEndDate) & "#) GROUP BY " & cstr(strReportType) &";"ElsestrSQL = "Select " & cstr(strReportType) & ", SUM(Hours) as SumOfHours FROM Results WHERE (PerDate >= #" & cdate(strStartDate) & "# and PerDate <= #" & cdate(strEndDate) & "# and TechName = '" & cstr(strtechname) & "') GROUP BY " & cstr(strReportType) &";"End IfSet rstSearch = Server.CreateObject("ADODB.Recordset")rstSearch.PageSize = PAGE_SIZErstSearch.CacheSize = PAGE_SIZE' Open our recordsetrstSearch.Open strSQL,strdbpathiRecordCount = rstSearch.RecordCountiPageCount = rstSearch.PageCount' Move to the page we need to show.rstSearch.AbsolutePage = iPageCurrent'this is line that contains the error(line 185)
How can I fix this problem...I think it has to do with the settings when I open the DB but I don't know what the settings should be to make it work correctly.
Thanks
Mark
View 4 Replies
View Related
Aug 27, 2007
Is there a way to change the background color of an field that has enable = off from the default "gray"? I can set it to transparent but I can't change the font color to see the data clearly.
Just trying to make the form "nice looking" to the user.
Thanks
Jeff
View 1 Replies
View Related
Dec 15, 2014
I have seen someone's database that had tiny circles containing a "?" which, when clicked, opened up a sentence or two. A search for "Tag" on this site strikes out, also.I am hoping to place these little links near fields that may need more explanation. In the ones I have seen before, the little explanation field that popped up disappeared as soon as the focus went elsewhere without the user having to close it. I have succeeded in using the tag property to open a true popup form, but this is clunkier than I want--would just like to learn how to do the other.
View 4 Replies
View Related
May 12, 2005
I have designed a software package based around an Access Database at my company (based in the UK). There is a good chance that the company will be able to sell the software and potentially make a handsome profit.
My boss wants me to sign an Intellectual Property Rights agreement. Does anybody know what this means? Which of my rights does it effect? Would it prevent me from developing the same software if I left the company?
Any help would be much appreciated. I've found some resources on the web but they seem to apply mainly to music. Just wondered if anyone had had a similar experience.
Cheers.
View 7 Replies
View Related
Sep 9, 2005
Hi All,
I am experiencing the following error when trying to execute this snippet of code:-
Run-Time Error 1004: Unable to set the LineStyle property of the Border class
appXL.Selection.Borders(xlEdgeTop).LineStyle = xlContinuous
appXL.Selection.Borders(xlEdgeLeft).LineStyle = xlContinuous
appXL.Selection.Borders(xlDiagonalDown).LineStyle = xlNone
appXL.Selection.Borders(xlDiagonalUp).LineStyle = xlNone
appXL.Selection.Borders(xlEdgeBottom).LineStyle = xlNone
appXL.Selection.Borders(xlEdgeRight).LineStyle = xlNone
appXL.Selection.Borders(xlInsideVertical).LineStyl e = xlNone
appXL.Selection.Borders(xlInsideHorizontal).LineSt yle = xlNone
It errors at the highlighted line above (xlEdgeTop).
I have tried numerouse things, but cannot figure it out. Have used this with With statements, moved the offending statement up and down the code, but to no avail.
The Excel cell I am trying to format is in the centre of the spreadsheet. ALl the other borders are fine, but this one doesn't want to know!
Thanks in advance,
Paul.
View 2 Replies
View Related
Mar 10, 2006
Does any one know of a way to toggle a multiselect listbox's property programmatically?
The One In The VBS Help doesn't work!
View 5 Replies
View Related
Mar 21, 2006
Hi all..
I use the following code in my application to select a particular column value in a list box..
myvalue = SearchResults_LB.Column(5, i)
In my computer the column count starts with 0. So, the above statement sets the myvalue to the 6th column. But when I install the same application on an other computer it sets myvalue to 5th column.
Looks like I need to set the base value of the listbox column property somewhere!
I hope it is an easy one for many of you.
Thanks in advance.
View 1 Replies
View Related
May 29, 2006
hi guys,
easy question.
when the DB is open a login form comes up. The issue is that the properties window for that form comes too.
any suggestion? thx max.
View 3 Replies
View Related