When i run this code i get an error ("Object reference not set to an instance of an object."). I don't know why this error is occuring, but i have found out that the error is in the code i highlighted in bold. Any ideas?VB Code:
Dim SQLUpdateStr As String 'SQL Update string SQLUpdateStr = "UPDATE Staff SET Address = @Address, BookingRights = @BookRight," & _ "Contract = @Contract, DOB = @DOB, Forename = @Forename, Gender = @Gender," & _ "LoginRights = @LoginRight, ManageRights = @ManageRight, MemberRights = @MemberRight," & _ "Position = @Position, Postcode = @Postcode, Salary = @Salary, StartDate = @StartDate," & _ "Surname = @Surname, [Telephone Number] = @TelNum" [B]'Set SQL statements daStaff.DeleteCommand.CommandText = "DELETE FROM Staff" 'Delete statement daStaff.InsertCommand.CommandText = "INSERT INTO Staff" 'Insert statement daStaff.UpdateCommand.CommandText = SQLUpdateStr 'Update statement[/B]




Reply With Quote