473,320 Members | 1,863 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,320 software developers and data experts.

Code to autofill value in form based on combo box value in Access 2007

Hello, I have a fairly simple database. In this dbase, there is a subform which basically holds menu values for the records. These values serve as the "notes" for each record.

OK, I find that I am typing a rather long string in many "notes" section of the subform. Rather than have to type this over and over again, I would like to automate this procedure. So I have tried to create an "Event Procedure" to accomplish this, but so far, the coding doesn't work as I would like. Here is what I have done so far:

Event Procedure = AfterUpdate

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_AfterUpdate()
  2. If NFA_Pre_Reveiw_Sent = "Foreign" Then [form.Web Review.Memo] "Per Jane Pfeiffer, NFA Compliance, no Web Reveiw needed"
  3.  
  4. End Sub
NFA_Pre_Review is the field which will have the value of "Foreign". As it stands, there are 4 values available in this combo box: " "; "Yes"; "No"; "Foreign". If Foreign is chosen, I would like "Per Jane Pfeiffer, NFA Compliance, no Web Review needed" to be placed in the subform field of memo. The form is called Web_Review and the field is called memo.

Can anyone please help me figure out why the event procedure doesn't work?

Thank you!
Jan 3 '08 #1
1 2151
Killer42
8,435 Expert 8TB
I believe you'll find much more info on this in the Access forum, so I'm going to move it over there.

In the meantime, is it possible that you need to "do your thing" in the BeforeUpdate event rather than AfterUpdate?
Jan 4 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ray Holtz | last post by:
Is it possible to autofill a field based on what is entered into another field in a form? My form has an employee field, and department field. In an Items Table, I have fields FldEmployee, and...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
1
by: meganrobertson22 | last post by:
hi everybody- what is the best way to add data from one form to another? i have 2 tables: person and contract. here are some of the fields. table: person personid (autonumber and primary...
6
by: bloukopkoggelmander | last post by:
All I am new to this site and hopefully would have a good time here. I am new to Microsoft Access and VBA and am currently involved in a project to create a new database for one of our company...
9
by: Ecohouse | last post by:
I have a main form with two subforms. The first subform has the child link to the main form identity key. subform1 - Master Field: SK Child Field: TrainingMasterSK The second subform has a...
1
by: leiger | last post by:
Hi, I need help with this problem as soon as possible (within a couple of days). This is the first time I have ever used Access 2007 and therefore I am having some problems - especially as I...
0
by: Randy | last post by:
Hi, I have some comboboxes that are created dynamically at run time based on user actions. I found a procedure on a message board to autofill the combobox text from the dataview that the...
13
by: BASSPU03 | last post by:
Hello, folks. This is my first post and I only began to work extensively with Access about 3 weeks ago. I'm running Access 2003 on Windows XP. I'd like a textbox in subform2 to reflect the value...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
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...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.