Results 1 to 3 of 3

Thread: Cell Can't Be Empty

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2022
    Posts
    4

    Cell Can't Be Empty

    Hello,

    Attached is an example of the problem.

    I have a table (form2) where I enter a value in 3 cells and through a calculation the total is displayed in a datagrid view (Form1). The calculations works but:
    1. If I don't enter anything in 1 cell, I get no value.
    2. if I want to empty 1 cell (no value) this does not work, the cell cannot be empty, however it is set with "Allow Nulls"


    I suspect this is due to the calculation, but is there a possibility to empty the cell and get a calculation?

    -Moderator Action: Attachment Removed-
    Last edited by dday9; Sep 30th, 2022 at 09:19 AM.

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,715

    Re: Cell Can't Be Empty

    I removed the attachment because it included the executable.

    Besides, rather than uploading your entire project and asking us to sift through it, why don't you copy/paste the relevant code? You could even use [code]' my code here[/code] tags to keep the formatting.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2022
    Posts
    4

    Re: Cell Can't Be Empty

    i load the view (form1) with
    Code:
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
                 Me.ViewTableAdapter.Fill(Me.TestDataSet.View)
        End Sub
    save the table (form2) with
    Code:
    Private Sub TableBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles TableBindingNavigatorSaveItem.Click
            Me.Validate()
            Me.TableBindingSource.EndEdit()
            Me.TableAdapterManager.UpdateAll(Me.TestDataSet)
    
        End Sub
    calculate the total with
    Code:
    CREATE VIEW [dbo].[View]
    	AS 
    	SELECT prijs1 + prijs2 + prijs3 as totaal
    	
    		FROM [Table]
    attached a small example without executables test.zip

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width