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

Error UPDATE query doesn't contain Multi Value Field

This is what I am working on. When patients count is 0, it works, but when it is increased, suppose 1, it gives an error: "An UPDATE or DELETE query doesn't contain Multi Value Field." What's the problem, Please help me out. Thank you very much.





Expand|Select|Wrap|Line Numbers
  1. rs = New ADODB.Recordset
  2.         With rs
  3.             .Open("Select * from Doctor where DName='" & cmbDoctors.Text & "'", cn, 2, 3)
  4.  
  5.             If .Fields("Patients").Value = 10 Then
  6.                 MsgBox("All appointments had been taken. Please Select another Doctor.")
  7.                 Exit Sub
  8.             End If
  9.             patient = Txtname.Text
  10.             If .Fields("Patients").Value = 0 Then
  11.                 .Fields("Patient0").Value = patient
  12.             ElseIf .Fields("Patients").Value = 1 Then
  13.                 .Fields("Patient1").Value = patient
  14.             ElseIf .Fields("Patients").Value = 2 Then
  15.                 .Fields("Patient2").Value = patient
  16.             ElseIf .Fields("Patients").Value = 3 Then
  17.                 .Fields("Patient3").Value = patient
  18.             ElseIf .Fields("Patients").Value = 4 Then
  19.                 .Fields("Patient4").Value = patient
  20.             ElseIf .Fields("Patients").Value = 5 Then
  21.                 .Fields("Patient5").Value = patient
  22.             ElseIf .Fields("Patients").Value = 6 Then
  23.                 .Fields("Patient6").Value = patient
  24.             ElseIf .Fields("Patients").Value = 7 Then
  25.                 .Fields("Patient7").Value = patient
  26.             ElseIf .Fields("Patients").Value = 8 Then
  27.                 .Fields("Patient8").Value = patient
  28.             ElseIf .Fields("Patients").Value = 9 Then
  29.                 .Fields("Patient9").Value = patient
  30.             End If
  31.             .Fields("Patients").Value += 1
  32.             .Fields("Fees").Value += txtAmount.Text
  33.             .Update()
  34.             .Close()
  35.         End With
Jun 1 '13 #1
3 1467
can u show the update() query
Jun 1 '13 #2
According my information, Update is stored query, used to update fields in database. But I'm not sure.
Jun 1 '13 #3
Oralloy
988 Expert 512MB
You should be able to look at the database and see all of the stored queries. I'm assuming it's Access, from the way you're writing your code.
Jun 1 '13 #4

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

Similar topics

1
by: Wayne | last post by:
I've created a form that has many option boxes to help users choose items (I need option boxes vs. combo boxes because they can choose multiple items per category). I've created an update query...
2
by: bobabooey2k | last post by:
I have an update query with one field having in its "Update to" cell a DLookup statement. This query takes 2-3 minutes on 3000 records. Can I avoid dlookup here using multiple queries? An...
3
by: aaronvb | last post by:
Hi there, I'm currently trying to fix up a database that has had many different people work on it and therefore is confusing me no end. Currently i am trying to update a field, in the table ...
2
by: Kc-Mass | last post by:
I have a form that users use to input the fiscal year for an update query. I have that value (after input sitting in a public variable and a Form control. How do I get Access to use that value...
2
by: eggie5 | last post by:
I have some code (C#) that runs an SQL update query that sets the value of a column to what the user passes. So, this causes an error when anything the user passes in has a ' character in it. I'm...
2
by: stoogots2 | last post by:
I have a field named sList in a Sql Server database table. The field has multiple delimited values (delimited with "|"). Example could be "1|2|3|4|5". I have a view with several fields (including...
0
by: lupis | last post by:
I am pretty new to vba. This is what I am trying to achieve. I have a form that onload displays all records in a form. I also have a searchbox with a button that should be able to take multiple...
15
by: amy1 | last post by:
Hello everyone, I'm new here and new to Access2007 as well! I have a multi-value field in a form, and would like to calculate the total of the selected values in this field and place the...
3
by: timleonard | last post by:
I use a query to select several fields from the table including a multi-value field. I then use the "DoCmd.TransferSpreadsheet acExport acSpreadsheetTypeExcel12" to send the info to an excel.xlsm...
19
by: jaad | last post by:
how do you reference a single value field to a multi-value field? I sometime use a macro in form1 to open form 2 containing the same ID example: Open form: WorkOrder where condition: ="="...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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.