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

ERROR: "enter parameter value"

29
Hello EveryOne,

I have a situation with a Form running an event; It works fine when it calls or manipulates number values; but when I put a character within the numbers or use alpha-numeric values, I get this error "enter parameter value" when i press my click action button with the alphanumeric value as the problem..

Please assist, I searched the entire forum and the net for answers, but nothin.

A......

I apologize for the inconvenience: Here is the code

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdAddDonor_Click()
  2. Dim strSQL As String
  3. strSQL = "INSERT INTO T_Patient_Donor ([Patient_ID], [Donor_ID]) VALUES (" & Patient.Value & ", " & DonorID.Value & ");"
  4.  DoCmd.SetWarnings True
  5. DoCmd.RunSQL (strSQL)
  6.  DoCmd.SetWarnings True
  7. MsgBox ("Donor has been added")
  8. DoCmd.Close acForm, Me.Name
  9. Forms!F_PatientCase2.DonorNum.SetFocus
  10.  Forms!F_PatientCase2.DonorNum.Requery
  11. End Sub
Aug 3 '09 #1
7 6122
ChipR
1,287 Expert 1GB
What data types are the fields you are trying to insert into?
Aug 3 '09 #2
adigga1
29
@ChipR
the data type is text or would you like me to check other attributes?
Aug 3 '09 #3
ChipR
1,287 Expert 1GB
Text values require delimiters around them in SQL. Like this:
Expand|Select|Wrap|Line Numbers
  1. strSQL = "INSERT INTO T_Patient_Donor ([Patient_ID], [Donor_ID]) VALUES ('" & Patient.Value & "''" & DonorID.Value & "');"
Aug 3 '09 #4
adigga1
29
@ChipR

Thank you ChipR for your response and suggestion; i will give this a shot and give status update.

Thanks again

A...
Aug 3 '09 #5
adigga1
29
@ChipR

ChipR, Thanks again for the edit; it works great; but I have one other question:

I now recieve this message " You are about to append 1 row(s)" confirmation message; I press "yes" then the code runs fine after that.

how to stop this message from showing? just run the code?

Thanks again

A...
Aug 3 '09 #6
ChipR
1,287 Expert 1GB
You can use "DoCmd.SetWarnings False" but make sure to always use "DoCmd.SetWarnings True" afterwards.
Aug 3 '09 #7
adigga1
29
@ChipR
Thank you again for all of your time, patience and assistance with this issue.

It works perfectly!!!! :-)

Regards,

A....
Aug 3 '09 #8

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

Similar topics

2
by: lgo | last post by:
I have read several variations of this topic posted on this news group. However I was not able to find the answer for my problem. I am trying to build code (see below) to update a large single...
4
by: Ondrej Spanel | last post by:
The code below does not compile with .NET 2003, I get folowing error: w:\c\Pokusy\delegTemplArg\delegTemplArg.cpp(11) : error C2993: 'float' : illegal type for non-type template parameter 'x' ...
2
by: drisso | last post by:
Hello, I have searched that error on these message boards, msdn and crystaldecisions.com. I found tutorials that showed how to export a crystal report to pdf, but like many others I am getting...
6
by: ineedahelp | last post by:
I have been working on trying to get some code to work in an ON CLICK EVENT. I am having trouble with the syntax of an SQL statement. The program was stopped without running to completion many...
3
by: Darin | last post by:
I have a problem I just can't figure out. I have a form with a subform, and the recordsource of the subform has criteria based on some unbound fields in the parent form so that data in the parent...
1
by: waltnixon | last post by:
I've got an MS Access query which runs fine when double clicked and returns all of the rows in a test database I'm building. I've set up a multi group report based on the query. I immediately...
3
by: myemail.an | last post by:
Hi all, I use Access 2007 and have come across this error a number of times. I have two tables (customer information) which should contain - ideally - the same data. I create a query to compare...
1
by: Sport Girl | last post by:
Hi everybody, please can anybody help with this question: I an working with Acees 2007, and everytime I run a report I have a dialog box prompting "Enter Parameter Value" requesting for a...
1
by: eBob.com | last post by:
I have some code which is trying to determine where text will wrap in a custom text box (which Inherits from Control). It determines the number of characters which will fit in the first line, but...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.