Results 1 to 2 of 2

Thread: Hi...how to select one record in datagrid and view to the datareport...

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    3

    Smile Hi...how to select one record in datagrid and view to the datareport...

    Name:  Baptismal.PNG
Views: 194
Size:  162.3 KBName:  Baptismal.PNG
Views: 194
Size:  162.3 KB

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2012
    Posts
    3

    Re: Hi...how to select one record in datagrid and view to the datareport...

    all the button you see above is functioning will except the select button...
    the screenshot you see is the MDIform and the child form baptismal

    this is the code:
    Private Sub Cmdselect_Click()
    cmdviewrecord.Show
    End Sub

    i enter the RecordID to the form cmdviewrecord into textID.text
    (general)
    Dim rs As ADODB.Recordset
    Dim conn As ADODB.Connection
    Private Sub cmdviewrecord_Click()
    Dim vrp As String
    vrp = "Select * from RECORDS where RecordID=" & "'" & TextID.Text & "'"
    Set rs = conn.Execute(vrp)
    If Not rs.EOF Then
    Set BLP.DataSource = rs
    BLP.Show
    Else
    MsgBox "Record ID Doesnt Exist", vbExclamation, "Error"
    TextID.Text = ""
    TextID.SetFocus
    Set rs = Nothing
    End If
    Unload Me
    End sub

    and the formload which is the connection
    Private Sub Form_Load()
    Dim conString As String
    Set conn = New ADODB.Connection
    conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\FOR SCHOOL STUDY\Software Engineering\SPCRKS\database\BDatabase1.mdb;Persist Security Info=False"
    conn.Open
    End Sub

    and when i run the program and check
    it says

    run time error
    data type mismatch in criteria expression

    and the set rs = conn.Execute(vrp) //statement is being highlight..

    please correct my code

    thank you...

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