Jump to content
Xtreme .Net Talk

hog

Avatar/Signature
  • Posts

    1011
  • Joined

  • Last visited

Everything posted by hog

  1. why don't you try this in the forms load event Me.TextBox1.Text = TestVar
  2. Well, not the most elegant way but it works:) Draw the shape, scan it, resize it then plot the coordinates in Paint:)
  3. New to all this but try using bezier curves
  4. Does anyone know how to obtain the coordinates for bezier curves based on a hand drawing? For example if I draw any shape how to get the correct x,y values for each coordinate set to get the required shape on the screen at the right size? Thnx:confused:
  5. Yep, but I'm not on that tariff:) I'm on the £8.99 pm one :)
  6. I signed up with FastHosts for £8.99 per month and get a whopping 1GB of web space. There interfacing and support is also excellent :) http://www.fasthosts.co.uk/
  7. not sure what exactly is your prblem, but have you tried right clicking on the field on your report and selecting Format and then setting the desired formatting?
  8. Wyrd, might be off beam here but could you not store the last 'incremented code' that was created? I may not be reading you thread properly however :)
  9. I know...it was driving me nuts!! All I know is this way works fine so I'll use it instead. One of life's mysteries :)
  10. hog

    Framework

    If you want it in order to run a .NET program you can download dotnetfx.exe from Microsoft.
  11. I've had a look around for info on this mutant and have drawn a blank so far :(
  12. Whoooooohooo VS 2003 is here already!! Now that was quick.....Time to play :) :) :)
  13. And the answer is.......yes I should use Scalar:) Public Function CanClose() As Boolean ' set internal error flag to false m_Error = False ' create SQL string to obtain total po cost m_strSQL = "SELECT COUNT(jobid) AS TotalRecords FROM tblJobs WHERE (contractid = ?) AND (active = ?) AND (jobdone = ?)" ' set properties of the oledbcommand object m_odcJob.CommandType = CommandType.Text m_odcJob.CommandText = m_strSQL ' set the parameter details m_odcJob.Parameters.Add("contractid", m_ContractID) m_odcJob.Parameters.Add("active", -1) m_odcJob.Parameters.Add("jobdone", -1) ' assign a connection m_odcJob.Connection = m_objConn ' try to obtain the sum of po cost and assign it to private member m_TotalCost Try m_odcJob.Connection.Open() If CType(m_odcJob.ExecuteScalar(), Integer) Then Return False Else Return True End If Catch objException As Exception ShowError("Location: Class Job" & ControlChars.CrLf & ControlChars.CrLf & _ "Procedure: CanClose(ByVal lngID As Long)" & ControlChars.CrLf & _ ControlChars.CrLf & "Error Text: " & objException.Message) ' set internal error flag to true m_Error = True Finally If m_odcJob.Connection.State.Open Then m_odcJob.Connection.Close() End If End Try End Function
  14. Try this: Global dblTotal As Double Global intPreviousID as Number If intPreviousID <> {YourTableNmae. itemID} Then intPreviousID = {YourTableNmae. itemID} dblTotal = 0 Else dblTotal = dblTotal + {YourTableNmae. DeliveryQty} End If formula=dblTotal
  15. Mmm, just a thought.....should I be using a Scalar query approcah instead?
  16. I have this code in my app which does the following. Prior to a user closing or deleting a contract the CanClose method of the job object is called to check if there are any jobs that have been done but are awaiting an invoice. If there are then the contract cannot be closed/deleted. Here is the code of the CanClose method: Public Function CanClose() As Boolean ' set internal error flag to false m_Error = False ' create a connection using global connection string m_objConn = New System.Data.OleDb.OleDbConnection(gconnConnection) ' set-up the SQL which will return records for selected id number with an invoice due m_strSQL = "SELECT tblJobs.jobid FROM tblJobs WHERE tblJobs.contractid = " & m_ContractID & " AND tblJobs.active = -1 AND tblJobs.jobdone = -1" ' create a new data adapter for the required data m_odaJob = New System.Data.OleDb.OleDbDataAdapter(m_strSQL, m_objConn) ' protect this section of code Try ' open the connection to the required database m_objConn.Open() ' fill the data table m_odaJob.Fill(m_dsJob, "tblJobs") ' if record count is greater than zero jobs exist with invoice due so return false If m_dsJob.Tables("tblJobs").Rows.Count >= 1 Then Return False Else Return True End If Catch objException As Exception ShowError("Location: Class Job" & ControlChars.CrLf & ControlChars.CrLf & _ "Procedure: CanClose(ByVal lngID As Long)" & ControlChars.CrLf & _ ControlChars.CrLf & "Error Text: " & objException.Message) ' set internal error flag to true m_Error = True Finally If m_objConn.State.Open Then ' close connection to database m_objConn.Close() End If End Try End Function The thing is this method return True whether there are invoices due or not. For example if I run it against a contract that has 3 jobs assigned to it, but none have been done yet the method should return True as there are no jobs with that id and with active and jobdone set to True. But the method returns False and reports a total of 3 records found? If I run this sql in Access it return no records as I would expect. Any clues:confused:
  17. I think the default for a dataadapter is to have Optimistic Concurrency set as True
  18. use this: Me.tbcWhatEver.SelectedTab = Me.tbcWhatEver.tbpYourFirstTabPage
  19. jfackler, thanks. I could not track this down, so just removed the code that was trying to close the data adapter following your advice above. Cheers :-)
  20. Yes, this book has be glued to it.......great fun!!!
  21. OK, if you want the 'running total' to be specific to each new item group include another global variable in the formula to store the previous items id. On the next call check that the item ids still match, if they don't reset the dblValue to 0 to start a new running total.
  22. You would use something like this: myReport.PrintToPrinter(1,True,1,999) This will print to the default printer. Parameters are: Number of copies Collatation Flag Start Page End Page (use 999) as an upper limit Also see the PrintOptions Method
  23. Yes I understand you. OK if you have two rows returned for example and you want to see a running total then the formula field approach I mentioned earlier will work.
  24. Have you inialised your commandbuilder? [ commBuilder = New System.Data.OleDbCommandBuilder(DAdapter)
  25. I have an object which has various methods that manipulate data in datasets, some of which get written back to the database. Where I open a connection I always ensure that the Finally statement includes a test to see if the connection is open and closes it accordingly. Likewise I do the same with Update connections thus: Finally If m_odaContract.UpdateCommand.Connection.State.Open Then ' close the connection m_odaContract.UpdateCommand.Connection.Close() End If End Try In the procedure where the above code belongs, there is some code that runs other methods and if they return True then the update code section runs. I am finding that if that section returns False the execution quite rightly jumps to the Finally section and performs that test. But the test is showing the Open state has the value 1 and therefore tries to execute the Close method which then error saying the object is not set? This is right as the code that performs the update has been bypassed so the object would not be set. Question is why is the open statement returning that it is open? I have been through my code and all the connection.close calls are present?
×
×
  • Create New...