Results 1 to 6 of 6

Thread: Coding for DBGrid1

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2007
    Posts
    19

    Coding for DBGrid1

    hello all,

    i am new to this forum, and have posted two other thread so far and had great help, wanted to thank all of you for that

    i am not good in vb6 so i do need further assistance.

    I am trying to select 3 fields from the Updater table and write the result into a nother table called Reporting, and i have the codes below, all works fine
    Code:
    Dim DB As Database
    Dim rs As Recordset
    Dim rs1 As Recordset
    Dim tname As String
    Dim strdate As Date
    Dim strdate2 As Date
    Dim SQL As String
    
    Set DB = OpenDatabase(App.Path & "\Project Light Speed.mdb")
    strdate = DateAdd("d", 7, (DTPickerWeek.Value) - 13)
    strdate2 = DTPickerWeek.Value
    
    SQL = "delete * from Reporting"
    DB.Execute SQL
    
    SQL = "insert into Reporting (Job_ID, PM_Tool, Task_Group, Task_Desc, Market, WBS_Desc, Taper_Code, WC_CLLI, Title, Dater, Work_Autho, LU, DA, Date_Ending) select * from [Updater] " & _
          "where Dater >=#" & strdate & "# And Dater <=#" & strdate2 & "# " & _
          "And Market='" & combomarket.Text & "' And WBS_Desc='" & combowbs.Text & "'"
    'Debug.Print SQL
    'Set rs = DB.OpenRecordset(SQL)
    DB.Execute SQL
               
    SQL = "UPDATE Reporting SET Date_Ending=#" & strdate2 & "#"
    DB.Execute SQL
    Right now what i did was to get a crystal report to read the records from table Reporting and display, which works, but when i tried to install it to the server, the server has alot of error for crystal report, to avoid all that, how do i code in vb that if i click a command1 button, all the records that was written into reporting willl be displayed at DBGrid1, please help

    joyce
    Last edited by Hack; Sep 26th, 2007 at 01:14 PM. Reason: Added Code Tags

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