473,324 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Insert Code In Work Events Of Existing Forms

Thanks to all who reply

OS: NT 4
Office: XP

Is there anyway I can type a Function name on a workevent of a form
(automatically)
Problem: If I have 50 Forms in a db and each of them now requries a
Function call at a certain Work Event. It's not a good idea of opening
50 forms and typing my function call at that work event. Are there any
wizards or Add-In or some code that I can write to avoid opening 50
forms and placing a function on the work Event

Thanks to all who reply
Nov 13 '05 #1
1 1153
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Perhaps this (untested):

Sub SetEvent(strEvent as string, strFunction as string)
' In:
' strEvent The event name you want to change
' strFunction The name of the function you want
' to set the event to.

dim frm as form
dim dbs as Object

set dbs = Application.CurrentProject

for each frm in dbs.AllForms
docmd.openform frm.name, acDesign
frm.Properties(strFunction) = strEvent
docmd.close acForm, frm.name, acSaveYes
next frm

End Sub

You'll probably want to put in error handling and/or exclusion criteria
so you don't change a form that you don't want to change.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQX6kWIechKqOuFEgEQKw0ACfeHW8IOLL+t9JSFn+blrF6M 4Rx7EAn3ni
TSUz5dNKgSxRIGtpQCNXZsYI
=VDMZ
-----END PGP SIGNATURE-----
Farooq wrote:
Thanks to all who reply

OS: NT 4
Office: XP

Is there anyway I can type a Function name on a workevent of a form
(automatically)
Problem: If I have 50 Forms in a db and each of them now requries a
Function call at a certain Work Event. It's not a good idea of opening
50 forms and typing my function call at that work event. Are there any
wizards or Add-In or some code that I can write to avoid opening 50
forms and placing a function on the work Event


Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
3
by: HateSpam | last post by:
I have a read-only form that allows the user to browse clients. There are buttons on the form that allow the user to 'Add New' or 'Edit Existing'. They both lead to the same form: frmClient ...
1
by: Abareblue | last post by:
I have no clue on how to insert a record into access. here is the whole thing using System; using System.Drawing; using System.Collections; using System.ComponentModel;
5
by: Rick Spiewak | last post by:
I need to generate a "buy" button as part of an ASP.NET page - this consists of a small HTML form with hidden fields, conforming to the requirements of a merchant credit card processor. PayPal is...
6
by: Bob Alston | last post by:
I am looking for Access reporting add-in that would be easy to use by end users. My key focus is on selection criteria. I am very happy with the Access report writer capabilities. As far as...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
13
by: shankindc | last post by:
Hi, I have a data entry form which opens default values each time the form is open. Requirement is that users can edit existing data in the form. When the form is closed, it shouldnt update the...
17
geolemon
by: geolemon | last post by:
This should be an easy one for anyone with basic forms experience (I'd hate for you guys to be bored!) :D I have a simple form, bound to a single table. I'd *like* the form to work this way:...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.