473,405 Members | 2,445 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,405 software developers and data experts.

How to fill in the blanks

Good morning everyone -

I have created a database full of information about folks that need to be interviewed (we are conducting an evaluation of trainings that they have attended). Every person from a particular state has replicated information... they all attended the same training, on the same date, conducted by the same organization. In an effort to cut down on the time that it takes to enter that information over and over and over again, I created some code for the back-end of the data entry form. However, when I try it, I get the following error message: "The expression After Update you entered as the event property setting produced the following error: invalid outside procedure". I've included the code below. Would someone mind taking a look at it and see what glaring errors pop out?? Thanks so much!

Private Sub Admin_Site_ID_AfterUpdate()

If Me![Admin_Site_ID] = Wisconsin Then Me![Respondent_information_Site_ID] = Wisconsin

If Me![Admin_Site_ID] = Wisconsin Then Me![Name_of_training] = [core_competencies]

If Me![Admin_Site_ID] = Wisconsin Then Me![Name_of_Faciliator/Organization] = [mental_health_association_of_milwaukee]

If Me![Admin_Site_ID] = Wisconsin Then Me![Date_of_Training] = [June_5]

If Me![Admin_Site_ID] = Wisconsin Then Me![Data_Collection_window] = [August_6 - 17]
Aug 1 '07 #1
5 1428
missinglinq
3,532 Expert 2GB
Right off the bat it's obvious that Wisconsin is not a number but rather text, which means that it's a string, so
= Wisconsin

should always be

= "Wisconsin"


Also, your references, such as Me![Date_of_Training] = [June_5] tellsAccess that June_5 is a field name, which I suspect it isn't. If [Date_of_Training] is defined as a date field, then the value you assign to it needs to be a date. If it's a text field, then the value assigned needs to be a string such as "June 5."

Linq ;0)>
Aug 1 '07 #2
Many thanks!!!!

Kathleen


Right off the bat it's obvious that Wisconsin is not a number but rather text, which means that it's a string, so
= Wisconsin

should always be

= "Wisconsin"


Also, your references, such as Me![Date_of_Training] = [June_5] tellsAccess that June_5 is a field name, which I suspect it isn't. If [Date_of_Training] is defined as a date field, then the value you assign to it needs to be a date. If it's a text field, then the value assigned needs to be a string such as "June 5."

Linq ;0)>
Aug 1 '07 #3
I made the above changes, and it still wasn't working. I've broken the different components into smaller ones so that I could troubleshoot, but it still isn't working for me. I no longer am getting an error message, it's just not doing what I want it to. The only thing that I can think of is that in one place (in the field property box) the field is called Admin.Site ID, and in the VBX box it is called Admin_Site_ID. Here is a little chunk of code:

Expand|Select|Wrap|Line Numbers
  1.  Private Sub Admin_Site_ID_AfterUpdate()
  2. If Me![Admin_Site_ID] = "Wisconsin" Then Me![Name_of_training] = "core competencies"
  3. If Me![Admin_Site_ID] = "Wisconsin" Then Me![Respondent_information_Site_ID] = "Wisconsin"
  4. End Sub 
Any ideas?? Thanks!

Many thanks!!!!

Kathleen
Aug 1 '07 #4
missinglinq
3,532 Expert 2GB
The other changes were needed, for the stated reasons. I think the problem is that you've got it in the Sub Admin_Site_ID_AfterUpdate() event! Sorry, I just noticed that! By this time the data has already been written to the table, so assigning values is useless. Try moving the same code to the Admin_Site_ID_BeforeUpdate() sub

Linq ;0)>
Aug 1 '07 #5
Thank you so much! I really appreciate your help!! Unfortunately, now its telling me that it can't find the field. The error message is: "Access can't find the field 'Admin_Site_ID' referred to in your expression. The code is below:

Expand|Select|Wrap|Line Numbers
  1.  Private Sub Admin_Site_ID_BeforeUpdate(Cancel As Integer)
  2. If Me![Admin_Site_ID] = "Wisconsin" Then Me![Name_of_training] = "core competencies"
  3.  
  4. End Sub
  5.  
Any ideas are much appreciated!! Thanks again.
Aug 1 '07 #6

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

Similar topics

1
by: Broida (spamless) | last post by:
Hi! I have a list of item and I need to populate two columns with all of the combinations (not permutations), omitting the paired elements. Example: If my list in column A has W, X, Y, Z. ...
1
by: Stephen H | last post by:
I'm a newbie to writing and running code in MS Access so the more detail the better for me when answering. Thanks. My Problem ( Or Challange , I should say ) is that I import a csv file into an...
1
by: Steve | last post by:
I imported data from a spreadsheet into an access table. is there a way to deal with the empty cells? currently they are empty fields but I dont know how to interact with them. This is my first...
2
by: brian_harris | last post by:
I have a 3rd party unmanged .dll. This has functions that will look up information and fill a C string passed to it with data. I want to use this data in .NET classes after it has been filled and...
0
by: alienstudios | last post by:
We have a table that has a multi-line per person record Here are the fields ID Gene1 Gene2 Gene3 Each person usually has two records (IE two Rows have ID 1) However in one row Gene 1 is...
8
by: cwhite | last post by:
i want to create a form where the user can choose from a list of names in table A associated with this name is a telephone and address on the form there will be a drop list for the name,...
1
by: tom c | last post by:
I am using Visual Web Developer 2005 Express Edition. I created a SQLDataSource just by draging the control to the form and filling in the blanks in the wizard. In code I need to use the...
34
by: Registered User | last post by:
Hi experts, I'm trying to write a program that replaces two or more consecutive blanks in a string by a single blank. Here's what I did: #include <stdio.h> #include <string.h> #define MAX 80
1
by: 2D Rick | last post by:
I imported a text file that lacks a "Part Number" for each record. Each blank below a given "Part Number" should have the same "Part Number" until the next "Part Number". How can I fill in the...
10
by: Diego F. | last post by:
Hi all. I have an application that receives a message from a socket in an array from a certain size. As the array size may be longer that the message received, the end of the array has blank...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.