Jump to content
Xtreme .Net Talk

hog

Avatar/Signature
  • Posts

    1011
  • Joined

  • Last visited

Everything posted by hog

  1. Just out of curiosity, why would you prefer to use and XML over the registry, is there an advantage in doing so? archer_coal, you'd be suprised at how many times I've had to explain it to people.......duh?? :-)) glad u like it
  2. At present if I want to create an object that will give me the schema of the underlying tables I use a select statement that uses a bogus value which I know will return no records, but will give me the schema. This is messy to say the least, so is there a more elegant/efficient method I can adopt:)
  3. I tend to use the registry as I think it neater than using ini files.
  4. Ditto, but I soon picked up on VB .NET and love it. I hate having to go back using VB6/VBA.
  5. we get our stuff from ComputerBox
  6. thanks Divil
  7. Not sure what you want to try to achieve here but I suspect you would need to either create an Access application object and figure out how to call the macro from that. Or use a shell call to open Access passing the macro name to be run when Access opens. You would need to modify the macro to close down Access once it had finished doing whatever it is that it does.
  8. Hohohohooh..... Thanks, now that put a smile on my face :-))
  9. You should have an option to choose/set a custom avatar on that form
  10. Spend my life programming and now investing time in VS.NET and have just been told my upgrade was rejected, even though there are others do less than me who are on the higher grade! Even better, the panel for my existing grade state my current job description means I am above there highest grade!!! Hey ho......just needed to get that off my chest:(
  11. click on the menu button user cp then select edit options. The last item allows you to set your avatar
  12. wyrd read my thread about this I posted some weeks ago as there was a lot of discussion about it. It may help you decide
  13. I haven't created an Insert command like this as yet, but I think this line should not have the quotes around the variable names VALUES(intSSNnumb, 'strHolder', 'strAmount') This would mean you are passing the text strHolder and strAmount to the query rather than the variable value. Try this: VALUES(intSSNnumb, strHolder, strAmount)
  14. Another point you should use an DBException type to check if the error that occured was due to no records rather than comparing the text output. You'll need to lookup the exact error constant for this.
  15. Your code is hard to follow, could use comments to say what you are doing. Why are you using the second statement to overwrite the first assignment? strName = tb.Name strName = tb.Text() I can't see that you have declared strSSNtext as anything, but the str prefix suggests you expect it to be a String. If it is then this line: strSQL = "SELECT * FROM Awarded WHERE awrdID=" & strSSNtext should read: strSQL = "SELECT * FROM Awarded WHERE awrdID= '" & strSSNtext & "'"
  16. If you have selected to have optimistic concurrency set on your dataadapter then when one user attempts to write to a record that has been changed by another user since the first user opened it, then you can trap the exception DBConcurrencyException and deal with it accordingly
  17. I'm not familier with how you are doing this, but I have great success using datasets as reportsource passed at runtime for a variety of reports all taking diferent parameters
  18. I was the one asjking this and the upshot was in this situation stick with Access. :-)
  19. I use this: intWhatEver = Convert.ToInt32(Math.Floor(1.88))
  20. Hey guys?.......now would I forget?
  21. Use: intMonth = DateTimePicker1.Value.Month
  22. Not sure as I haven't looked yet to see if this is in VB.NET but I used to use the DoEvents() method when using VBA to allow other things to happen whilst slow bits were in progress
  23. This is how I cycled through all the controls on my tabcontrol: Private Sub GetControlHashCodes() ' obtain the name and a unique hashcode of each control for reference purposes when updating the ' form with job data Dim pnlPanel, tbcTabControl, tbpTabPage, ctlControl As Object Dim intX As Integer Try ' cycle through panel controls, only one in this instance For Each pnlPanel In Me.Controls ' cycle through tabcontrol controls, only one in this instance For Each tbcTabControl In pnlPanel.Controls ' cycle through tabpages of tabcontrol For Each tbpTabPage In tbcTabControl.Controls ' cycle through controls on each tabpage For Each ctlControl In tbpTabPage.Controls ' store the controls name and hashcode in table, filter required controls only Select Case Microsoft.VisualBasic.Left(ctlControl.name, 3) Case "txt", "rtb", "cbo", "dtm", "tdm", "chk", "pic" m_htControlsHashTable.Add(ctlControl.Name, ctlControl) End Select Next Next Next Next Catch objException As Exception ShowError("Location: Class frmJob" & ControlChars.CrLf & ControlChars.CrLf & _ "Procedure: GetControlHashCodes()" & ControlChars.CrLf & _ ControlChars.CrLf & "Error Text: " & objException.Message) End Try End Sub Then when I need to reference them I use this: Private Sub ClearTabPages() Dim intX As Integer, intPageIndex As Integer = 11 Try ' cycle through the hashtable and clear/initialise referenced controls For intX = 0 To intPageIndex DirectCast(m_htControlsHashTable("txtDueDate" & intX + 1), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("txtSupplier" & intX + 1), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("tdmJobTime" & intX + 1), DateTimePicker).Text = "00:00" DirectCast(m_htControlsHashTable("txtJobRef" & intX + 1), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("txtInvoiceNo" & intX + 1), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("txtInvoiceAmount" & intX + 1), TextBox).Text = 0 DirectCast(m_htControlsHashTable("txtEngineer" & intX + 1), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("txtGRN" & intX + 1), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("rtbComments" & intX + 1), RichTextBox).Text = String.Empty DirectCast(m_htControlsHashTable("dtmJobDate" & intX + 1), DateTimePicker).Text = Today DirectCast(m_htControlsHashTable("dtmInvoiceDate" & intX + 1), DateTimePicker).Text = Today DirectCast(m_htControlsHashTable("cboType" & intX + 1), ComboBox).Text = String.Empty DirectCast(m_htControlsHashTable("picCompleted" & intX + 1), PictureBox).Visible = False Next DirectCast(m_htControlsHashTable("txtTotalJobs"), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("txtTotalJobsCompleted"), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("txtPOCost"), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("txtInvoicedToDate"), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("txtOverCharged"), TextBox).Text = String.Empty DirectCast(m_htControlsHashTable("txtTotalHours"), TextBox).Text = String.Empty Catch objException As Exception ShowError("Location: Class frmJob" & ControlChars.CrLf & ControlChars.CrLf & _ "Procedure: ClearTabPages()" & ControlChars.CrLf & _ ControlChars.CrLf & "Error Text: " & objException.Message) End Try End Sub Works wonders :-)
  24. Sorted this... It helps if when calling the report I pass the correct dataset.....DOH. Still the investigative work looking into this has given me new insight into VB and crystal reports
  25. Crap I can't believe I did figure this out sooner??? Of course manually enter the sql into the sql command text property of the oledbdataadapter...bingo! I appear to be getting blinded by the new stuff in VB as I have entered sql direct into record source properties in Access loads of times. Thanks Derek for pointing me in the right direction :-)
×
×
  • Create New...