All,
I have two forms, the main form contains information on the clients survey, the second form contains information about the questions. Before I launch the second form I exec a sql proc that makes sure that all of the information needed on the second form is included in the DB, if it is not there I insert it. I do this by:
Once I open frmQuestions I create a SQL String and set that equal to the RecordSource Property of frmQuestions:
All of this works great if there is no inserting, but if I insert anything the RecordSource is null (at EOF). I know I am executing two types of SQL, one on the actual SQL server and one inside the access db, but the tables are linked, shouldn't the access tables refresh? If I pause the execution of the code right after my stored proc call I can see the data in the access tables. I can take the RecordSource Sql and paste it into a Access Query and get the information. Can anyone please help?
Journeyman -- The Order of the Seekers of Truth and Penitence
I have two forms, the main form contains information on the clients survey, the second form contains information about the questions. Before I launch the second form I exec a sql proc that makes sure that all of the information needed on the second form is included in the DB, if it is not there I insert it. I do this by:
Code:
Dim SqlStr As String
Dim ConnStr As String
Dim oConn As ADODB.Connection
Dim rs As ADODB.Recordset
ConnStr = "Provider=SQLOLEDB.1...."
Set oConn = New ADODB.Connection
Set rs = New ADODB.Recordset
oConn.Open ConnStr
SqlStr = "Exec NewSurvey '" & sDNIS & "', " & sItem
rs.Open SqlStr, oConn
Set rs = Nothing
Set oConn = Nothing
DoCmd.OpenForm "frmQuestions"
Once I open frmQuestions I create a SQL String and set that equal to the RecordSource Property of frmQuestions:
Code:
SqlStr = "Select S.SurveyId, S.ClientName, Q.QuestionNumber, Q.QuestionText" & _
" From SurveyMaster S" & _
" Inner Join QuestionMaster Q on Q.SurveyId = S.SurveyId" & _
" Where ActiveDNIS = '" & sDNIS & "'" & _
" and Item = " & sItem
Me.RecordSource = SqlStr
All of this works great if there is no inserting, but if I insert anything the RecordSource is null (at EOF). I know I am executing two types of SQL, one on the actual SQL server and one inside the access db, but the tables are linked, shouldn't the access tables refresh? If I pause the execution of the code right after my stored proc call I can see the data in the access tables. I can take the RecordSource Sql and paste it into a Access Query and get the information. Can anyone please help?
Journeyman -- The Order of the Seekers of Truth and Penitence