Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by brownfox1

  1. brownfox1

    date comparison

    This has got me. I have a table "Docket" with one record in it that's a date in "general date" "date/time format". 01/08/2007 17:45:00 But when I run this query: SELECT * from Docket WHERE Docket.Date > #01/08/2007 13:43:00# AND Docket.Date < #01/08/2007 21:43:00# I get no result, but when I...
  2. brownfox1

    Add command button to datagrid

    Thanks Bob, I get that bit. The code I need is that when a row in the grid is selected and the user hits the edit button, the Primary key value of the record in the DataGrid is assigned to a variable that can be used in a sql query to populate the form so that the record can be shown modally. I...
  3. brownfox1

    Add command button to datagrid

    Thanks for your help guys. I've added a general edit button, which when pressed should take the user to a form that shows the particular record "modally" so they can edit. But what's the code behind the edit button. I'm messing around with this Private Sub cmdEditRow_Click() MsgBox...
  4. brownfox1

    Add DataGrid at runtime

    Ok this is weird: Me.Controls.Add "MSDataGridLib.DataGrid", "DataGrid1" Dim DataGrid1 As DataGrid Set DataGrid1 = Me.Controls(Me.Controls.Count - 1) 'Set DataGrid1 = Me.Controls("DataGrid1") DataGrid1.Visible = True MsgBox (DataGrid1.Visible & " " & rs.RecordCount) Set...
  5. brownfox1

    Add DataGrid at runtime

    Thanks for your help guys. I'm now not getting any error messages but the grid is not displying any data. Here is my code. P.S There is nothing on the form in object view.Option Explicit Dim db_file As String Dim statement As String Dim conn As ADODB.Connection Dim rs As ADODB.Recordset Dim...
  6. brownfox1

    Add DataGrid at runtime

    Thanks Glasgow, but I'm still having problems...Set rs = New ADODB.Recordset With rs .ActiveConnection = conn .CursorLocation = adUseServer .CursorType = adOpenKeyset .LockType = adLockOptimistic .Properties("IRowsetIdentity") = True 'remove comment to...
  7. brownfox1

    Add DataGrid at runtime

    Thanks Bob but I could not get that code to work with a DataGrid only: buttons and text box's...Option Explicit ' If you are adding an ActiveX control at run-time that is ' not referenced in your project, you need to declare it ' as VBControlExtender. Dim WithEvents ctlDynamic As...
  8. brownfox1

    Add command button to datagrid

    My DataGrid is based on a jet sql query as a recordset, but I would like to add a button to the grid to edit a particular record. The sql query is a hugh join of tables so I don't want the datagrid to be edited directly. I hope I have asked this question in a clear way (P.S visual basic 6.0)...
  9. brownfox1

    Add DataGrid at runtime

    I want to do something like this but with a datagrid... 01 Option Explicit 02 `WithEvents is a way tell the program to 03 `respect all the events that are associated 04 `a CommandButton such as the click event. 05 Private WithEvents cmdMyButton As CommandButton 06 07 Private Sub Form_Load() 08...
  10. brownfox1

    Add DataGrid at runtime

    No, sorry, visual basic 6. I got add.control from google, didn't realise it a was .net thing
  11. brownfox1

    Add DataGrid at runtime

    Is this possible? Maybe with Add.Control...?

Part and Inventory Search

Back
Top