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

Run time error 2450 - Only passing data between forms based on a value ..

On a specific value on a drop down, I want to pop open a new form and pass through values from the previous screen - I am getting the 2450 error as the form only pops on the valid value, therefore if the form doesn't open, then I get the error as it is still trying to pass the values. Do I need to put in some more code? I have the following at the moment, but don't know if I need an if and else statement? To stop it from trying to pass through the values if the specific value isn't chosen ...

Expand|Select|Wrap|Line Numbers
  1. Private Sub Reason_AfterUpdate()
  2. If Me.Reason = "1" Then DoCmd.OpenForm "Vaccinations", , , , acFormAdd
  3.     Forms!Vaccinations.Horse_Vaccinated = Me.Related_Horse
  4.     Forms!Vaccinations.Date_of_Last_Vaccination = Me.Interaction_Date
  5. End Sub
Thanks!

Julie
Jun 1 '10 #1
2 2172
missinglinq
3,532 Expert 2GB
I suspect your problem is caused because you have no End IF for your If...Then! If you did, and placed it after passing the values, they wouldn't be passed unless the condition was met and the form Vaccinations opened. Try

Expand|Select|Wrap|Line Numbers
  1. Private Sub Reason_AfterUpdate()
  2. If Me.Reason = "1" Then 
  3.     DoCmd.OpenForm "Vaccinations", , , , acFormAdd
  4.     Forms!Vaccinations.Horse_Vaccinated = Me.Related_Horse
  5.     Forms!Vaccinations.Date_of_Last_Vaccination = Me.Interaction_Date
  6.  End If
  7. End Sub
and see what happens.

Welcome to Bytes!

Linq ;0)>
Jun 2 '10 #2
Thank you, Thank you, Thank you!!!! It worked perfectly!!! I knew it was probably something easy and obvious! J
Jun 2 '10 #3

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

Similar topics

15
by: Dave | last post by:
I'm currently working on a small project (admitedly for my CS class) that compares the time difference between passing by value and passing by reference. I'm passing an array of 50000 int's. ...
5
by: Jack | last post by:
Hi, I need to pass multple variables in a link in order to go to a asp page with the two varables. The following are the values of the variables using response.write: <%'Response.Write Mypage...
2
by: Bill Short | last post by:
Hello All, I have a popup form that is called from a command button on the main form. The main form's data source is tblA. The data source for the popup form is a query that is based on tblA. ...
1
by: Wayne Aprato | last post by:
What can cause Access to bring up Runtime Error 2450 saying that it can't find a particular form when the form is definitely open? I am opening the form and then checking if fields are populated...
1
by: ArcadeJr | last post by:
Good morning all! I have been getting a Run-time Error message #3464 - Data Type mismatch in criteria expression. While trying to run a query. I have a database where the field Asset_Number...
17
by: MLH | last post by:
A97 Topic: If there is a way to preserve the values assigned to global variables when an untrapped runtime error occurs? I don't think there is, but I thought I'd ask. During development, I'm...
2
by: gmccallum | last post by:
I have a data entry screen using controls bound through a bindingSource, TableAdaptor and a BindingNavigator to move through the records. When I have an data entry error (such as Null for a value)...
1
by: phoebus | last post by:
Hi, I am trying to fix an access database for someone. They are having an issue on a particular form when entering data. When any character gets typed into the form, the below error gets...
3
by: OG | last post by:
I'm trying to learn C# 2008 on Microsoft's MSDN. Their walkthrough example on passing data between forms at http://msdn.microsoft.com/en-us/library/ms171925.aspx had this error in the C# version...
1
by: zedd | last post by:
Hi, I orignaly posted this with the error above, however I am still trying to solve it on my own, and found that some of my syntax in the query was not correct and I corrected it. But i am still...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.