Error UPDATE query doesn't contain Multi Value Field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WaqasAnsari
    New Member
    • Jun 2013
    • 2

    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.





    Code:
    rs = New ADODB.Recordset
            With rs
                .Open("Select * from Doctor where DName='" & cmbDoctors.Text & "'", cn, 2, 3)
    
                If .Fields("Patients").Value = 10 Then
                    MsgBox("All appointments had been taken. Please Select another Doctor.")
                    Exit Sub
                End If
                patient = Txtname.Text
                If .Fields("Patients").Value = 0 Then
                    .Fields("Patient0").Value = patient
                ElseIf .Fields("Patients").Value = 1 Then
                    .Fields("Patient1").Value = patient
                ElseIf .Fields("Patients").Value = 2 Then
                    .Fields("Patient2").Value = patient
                ElseIf .Fields("Patients").Value = 3 Then
                    .Fields("Patient3").Value = patient
                ElseIf .Fields("Patients").Value = 4 Then
                    .Fields("Patient4").Value = patient
                ElseIf .Fields("Patients").Value = 5 Then
                    .Fields("Patient5").Value = patient
                ElseIf .Fields("Patients").Value = 6 Then
                    .Fields("Patient6").Value = patient
                ElseIf .Fields("Patients").Value = 7 Then
                    .Fields("Patient7").Value = patient
                ElseIf .Fields("Patients").Value = 8 Then
                    .Fields("Patient8").Value = patient
                ElseIf .Fields("Patients").Value = 9 Then
                    .Fields("Patient9").Value = patient
                End If
                .Fields("Patients").Value += 1
                .Fields("Fees").Value += txtAmount.Text
                .Update()
                .Close()
            End With
    Last edited by Rabbit; Jun 2 '13, 04:52 AM. Reason: Please use code tags when posting code.
  • Syed Hadi
    New Member
    • Dec 2012
    • 56

    #2
    can u show the update() query

    Comment

    • WaqasAnsari
      New Member
      • Jun 2013
      • 2

      #3
      According my information, Update is stored query, used to update fields in database. But I'm not sure.

      Comment

      • Oralloy
        Recognized Expert Contributor
        • Jun 2010
        • 988

        #4
        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.

        Comment

        Working...