Hi, would you please post the code that is creating the error. That would be all of the code including the declaration of con
Thanks
Dim CON As New ADODB.Connection
Dim RS As ADODB.Recordset
Dim strTest As String
Dim myquery As Variant
Dim accdb As String ' equivalent to sql query
Sub CONOPEN()
Set CON = New ADODB.Connection
Set RS = New ADODB.Recordset
CON.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data" _
& "source=E:\VB_image\storyboard\storyboard.mdb"
CON.Open
Set RS = CON.Execute(accdb, adOpenDynamic)
End Sub
Sub CONCLOSE()
' Close Recordset/Dbase
RS.Close
CON.Close
' Clear the memory
Set RS = Nothing
Set CON = Nothing
End Sub
Private Sub Form_Load()
accdb = "SELECT * FROM story" & _
"WHERE projectid='" & myquery & "'"
Call CONOPEN
project_txt.Text = RS!project
date_txt.Text = RS!Date
episode.Text = RS!episode
scene_txt.Text = RS!scene
seq_txt.Text = RS!sequence
shot_txt.Text = RS!shot
action_txt.Text = RS!Action
dialogue_txt.Text = RS!dialogue
camera_txt.Text = RS!camera
Call CONCLOSE
End Sub
Private Sub episode_Click()
On Error Resume Next
myquery = episode.Text 'Load selected ComboBox text into a variable
accdb = "SELECT * FROM story " & _
"WHERE projectid= '" & myquery & "' "
Call CONOPEN ' Open dbase & Recordset
' Populate TextBoxes
project_txt.Text = RS!project
date_txt.Text = RS!Date
scene_txt.Text = RS!scene
seq_txt.Text = RS!sequence
shot_txt.Text = RS!shot
action_txt.Text = RS!Action
dialogue_txt.Text = RS!dialogue
camera_txt.Text = RS!camera
Call CONCLOSE ' Close dbase & Recordset
End Sub