468,539 Members | 1,586 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,539 developers. It's quick & easy.

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 1313
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
983 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

Post your reply

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

Similar topics

1 post views Thread by Wayne | last post: by
2 posts views Thread by eggie5 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.