Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 15th, 2008, 04:03 PM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Change Form Code with VBA

Hi everyone,

I am building a database that collects data from the user and builds a table to collect date and a Form to input that data.

I have managed to build the tables with createtabledef method and build the form and create the controls with the createcontrol method.

I now need to set the afterupdate event to run a specific function and compute a value from two or more fields on the form, known only after collecting the data from the user: for example set the afterupdate event of field 1 and field 2 to sum field 1, field 2 and set field 3 to equal the result.

I tried building a public function in the module that creates the forms and tables however access only let me call "[event procedure]" or a macro from the event property.

Any help would be appreciated.
Reply With Quote
  #2 (permalink)  
Old October 17th, 2008, 07:38 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Automating an event procedure for a control on a form that is not created and named yet that is bound to a record source not yet created and named, etc., is probably doable but very tricky. I wish I could help, but I cannot without taking more time than I have to offer.

I've always been fascinated by posts where people describe what you did, i.e. buidling forms and tables from scratch at run-time. Wouldn't it be easier, knowing what the data is for and the business practice, to build the forms and tables ahead of time and have them ready BEFORE data is entered? It would make what you need MUCH easier.

Could you educate me on the advantages of the "on the fly" approach to table and form building?

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote
  #3 (permalink)  
Old October 17th, 2008, 11:45 AM
Registered User
 
Join Date: May 2008
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I generally agree with you.

However, this specific database is intended to standardize treatment checklists of wounded patients in a multiple casualty and variable environment for EMT instruction. Oh and i forgot to mention multiple instructors as well.

The only constant being the treatment algorithm. The database application "needs" to get input from the instructor about the drill setting, and patient injuries and condition, and manufacture a table for the data and a form to assess EMT performance on scene.

After several EMTs have undergone the drill under the supervision of several different instructors, The database will then "fold" these tables and form and leave only the assessment of performance in a permanent table.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill datasheet/Continuous form with vba code only Galateo Access VBA 0 May 9th, 2008 09:39 AM
Change tbl permissions using VBA feets Access VBA 1 October 12th, 2007 01:19 AM
VBA code to Search All Text Fields on a form dezmond2 BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 1 July 7th, 2007 11:58 AM
Code works in Excel VBA but not Access VBA fossx Access VBA 2 May 21st, 2007 08:00 AM
change paper's format with VBA exarkuun Excel VBA 1 December 9th, 2003 11:34 AM



All times are GMT -4. The time now is 12:01 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.