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..